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; }
virtual ~FChildWaiterThread() { // remove ChildWaiterThreadsArrayGuard.Lock(); ChildWaiterThreadsArray.RemoveSingle(this); ChildWaiterThreadsArrayGuard.Unlock(); }
void FManifestBuilderImpl::AddDataScanner(FDataScannerRef Scanner) { DataScannersCS.Lock(); DataScanners.Add(MoveTemp(Scanner)); DataScannersCS.Unlock(); CheckForWork->Trigger(); }
FChildWaiterThread(pid_t InChildPid) : ChildPid(InChildPid) { // add ourselves to thread array ChildWaiterThreadsArrayGuard.Lock(); ChildWaiterThreadsArray.Add(this); ChildWaiterThreadsArrayGuard.Unlock(); }
FDataScannerPtr FManifestBuilderImpl::GetNextScanner() { FDataScannerPtr Result; DataScannersCS.Lock(); if (DataScanners.Num() > 0) { Result = DataScanners[0]; DataScanners.RemoveAt(0); } DataScannersCS.Unlock(); return Result; }