| 525 | } |
| 526 | |
| 527 | void CsoundPerformanceThread::csPerfThread_constructor(CSOUND *csound_) |
| 528 | { |
| 529 | csound = csound_; |
| 530 | firstMessage = (CsoundPerformanceThreadMessage*) 0; |
| 531 | lastMessage = (CsoundPerformanceThreadMessage*) 0; |
| 532 | queueLock = (void*) 0; |
| 533 | pauseLock = (void*) 0; |
| 534 | flushLock = (void*) 0; |
| 535 | recordLock = (void *) 0; |
| 536 | perfThread = (void*) 0; |
| 537 | paused = 1; |
| 538 | status = CSOUND_MEMORY; |
| 539 | cdata = 0; |
| 540 | processcallback = 0; |
| 541 | running = 0; |
| 542 | queueLock = csoundCreateMutex(0); |
| 543 | if (!queueLock) |
| 544 | return; |
| 545 | pauseLock = csoundCreateThreadLock(); |
| 546 | if (!pauseLock) |
| 547 | return; |
| 548 | flushLock = csoundCreateThreadLock(); |
| 549 | if (!flushLock) |
| 550 | return; |
| 551 | recordLock = csoundCreateMutex(0); |
| 552 | if (!recordLock) |
| 553 | return; |
| 554 | try { |
| 555 | lastMessage = new CsPerfThreadMsg_Pause(this); |
| 556 | } |
| 557 | catch (std::bad_alloc&) { |
| 558 | return; |
| 559 | } |
| 560 | firstMessage = lastMessage; |
| 561 | recordData.cbuf = NULL; |
| 562 | recordData.sfile = NULL; |
| 563 | recordData.thread = NULL; |
| 564 | recordData.running = false; |
| 565 | |
| 566 | recordData.mutex = csoundCreateMutex (0); |
| 567 | recordData.condvar = csoundCreateCondVar(); |
| 568 | |
| 569 | perfThread = csoundCreateThread(csoundPerformanceThread_, (void*) this); |
| 570 | if (perfThread) { |
| 571 | status = 0; |
| 572 | running = 1; |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | // ---------------------------------------------------------------------------- |
| 577 |
nothing calls this directly
no test coverage detected