mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Revert "avoid pessimizing audio slave lock contention"
This reverts commit 3508e71753
.
This commit is contained in:
parent
3508e71753
commit
eafbeb6d44
1 changed files with 13 additions and 12 deletions
|
@ -27,7 +27,7 @@ void AudioMixerSlaveThread::run() {
|
|||
bool stopping = _stop;
|
||||
notify(stopping);
|
||||
if (stopping) {
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,13 +80,14 @@ void AudioMixerSlavePool::mix(ConstIter begin, ConstIter end, unsigned int frame
|
|||
_queue.emplace(node);
|
||||
});
|
||||
|
||||
// mix
|
||||
_numStarted = _numFinished = 0;
|
||||
_slaveCondition.notify_all();
|
||||
|
||||
// wait
|
||||
{
|
||||
Lock lock(_mutex);
|
||||
|
||||
// mix
|
||||
_numStarted = _numFinished = 0;
|
||||
_slaveCondition.notify_all();
|
||||
|
||||
// wait
|
||||
_poolCondition.wait(lock, [&] {
|
||||
assert(_numFinished <= _numThreads);
|
||||
return _numFinished == _numThreads;
|
||||
|
@ -153,12 +154,12 @@ void AudioMixerSlavePool::resize(int numThreads) {
|
|||
}
|
||||
|
||||
// ...cycle them until they do stop...
|
||||
_numStopped = 0;
|
||||
while (_numStopped != (_numThreads - numThreads)) {
|
||||
_numStarted = _numFinished = _numStopped;
|
||||
_slaveCondition.notify_all();
|
||||
{
|
||||
Lock lock(_mutex);
|
||||
{
|
||||
Lock lock(_mutex);
|
||||
_numStopped = 0;
|
||||
while (_numStopped != (_numThreads - numThreads)) {
|
||||
_numStarted = _numFinished = _numStopped;
|
||||
_slaveCondition.notify_all();
|
||||
_poolCondition.wait(lock, [&] {
|
||||
assert(_numFinished <= _numThreads);
|
||||
return _numFinished == _numThreads;
|
||||
|
|
Loading…
Reference in a new issue