Пример #1
0
bool GMESong::StartTrack(int track, bool getcritsec)
{
	gme_err_t err;

	if (getcritsec)
	{
		CritSec.Enter();
	}
	err = gme_start_track(Emu, track);
	if (getcritsec)
	{
		CritSec.Leave();
	}
	if (err != NULL)
	{
		Printf("Could not start track %d: %s\n", track, err);
		return false;
	}
	CurrTrack = track;
	GetTrackInfo();
	if (!m_Looping)
	{
		gme_set_fade(Emu, CalcSongLength());
	}
	return true;
}
Пример #2
0
	virtual ~FChildWaiterThread()
	{
		// remove
		ChildWaiterThreadsArrayGuard.Lock();
		ChildWaiterThreadsArray.RemoveSingle(this);
		ChildWaiterThreadsArrayGuard.Unlock();
	}
Пример #3
0
	void FManifestBuilderImpl::AddDataScanner(FDataScannerRef Scanner)
	{
		DataScannersCS.Lock();
		DataScanners.Add(MoveTemp(Scanner));
		DataScannersCS.Unlock();
		CheckForWork->Trigger();
	}
Пример #4
0
	FChildWaiterThread(pid_t InChildPid)
		:	ChildPid(InChildPid)
	{
		// add ourselves to thread array
		ChildWaiterThreadsArrayGuard.Lock();
		ChildWaiterThreadsArray.Add(this);
		ChildWaiterThreadsArrayGuard.Unlock();
	}
Пример #5
0
	FDataScannerPtr FManifestBuilderImpl::GetNextScanner()
	{
		FDataScannerPtr Result;
		DataScannersCS.Lock();
		if (DataScanners.Num() > 0)
		{
			Result = DataScanners[0];
			DataScanners.RemoveAt(0);
		}
		DataScannersCS.Unlock();
		return Result;
	}