MCPcopy Create free account
hub / github.com/csound/csound / Join

Method Join

interfaces/csPerfThread.cpp:700–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700int CsoundPerformanceThread::Join()
701{
702 int retval;
703 retval = status;
704
705 if (recordData.running) {
706 recordData.running = false;
707 csoundCondSignal(recordData.condvar);
708 csoundJoinThread(recordData.thread);
709 }
710 if (perfThread) {
711 retval = csoundJoinThread(perfThread);
712 perfThread = (void*) 0;
713 }
714
715 // delete any pending messages
716 {
717 CsoundPerformanceThreadMessage *msg;
718 msg = (CsoundPerformanceThreadMessage*) firstMessage;
719 firstMessage = (CsoundPerformanceThreadMessage*) 0;
720 lastMessage = (CsoundPerformanceThreadMessage*) 0;
721 while (msg) {
722 CsoundPerformanceThreadMessage *nxt = msg->nxt;
723 delete msg;
724 msg = nxt;
725 }
726 }
727 // delete all thread locks
728 if (queueLock) {
729 csoundDestroyMutex(queueLock);
730 queueLock = (void*) 0;
731 }
732 if (pauseLock) {
733 csoundNotifyThreadLock(pauseLock);
734 csoundDestroyThreadLock(pauseLock);
735 pauseLock = (void*) 0;
736 }
737 if (flushLock) {
738 csoundNotifyThreadLock(flushLock);
739 csoundDestroyThreadLock(flushLock);
740 flushLock = (void*) 0;
741 }
742
743 running = 0;
744 return retval;
745}
746
747/**
748 * Waits until all pending messages (pause, send score event, etc.)

Callers 5

test_perfthreadFunction · 0.80
test_recordFunction · 0.80
test_serverFunction · 0.80
CsoundPTjoinFunction · 0.80

Calls 5

csoundCondSignalFunction · 0.85
csoundJoinThreadFunction · 0.85
csoundDestroyMutexFunction · 0.85
csoundNotifyThreadLockFunction · 0.85
csoundDestroyThreadLockFunction · 0.85

Tested by 3

test_perfthreadFunction · 0.64
test_recordFunction · 0.64
test_serverFunction · 0.64