| 1539 | |
| 1540 | |
| 1541 | void ALCcontext::processUpdates() |
| 1542 | { |
| 1543 | std::lock_guard<std::mutex> _{mPropLock}; |
| 1544 | if(mDeferUpdates.exchange(false)) |
| 1545 | { |
| 1546 | /* Tell the mixer to stop applying updates, then wait for any active |
| 1547 | * updating to finish, before providing updates. |
| 1548 | */ |
| 1549 | mHoldUpdates.store(true, std::memory_order_release); |
| 1550 | while((mUpdateCount.load(std::memory_order_acquire)&1) != 0) |
| 1551 | std::this_thread::yield(); |
| 1552 | |
| 1553 | if(!mPropsClean.test_and_set(std::memory_order_acq_rel)) |
| 1554 | UpdateContextProps(this); |
| 1555 | if(!mListener.PropsClean.test_and_set(std::memory_order_acq_rel)) |
| 1556 | UpdateListenerProps(this); |
| 1557 | UpdateAllEffectSlotProps(this); |
| 1558 | UpdateAllSourceProps(this); |
| 1559 | |
| 1560 | /* Now with all updates declared, let the mixer continue applying them |
| 1561 | * so they all happen at once. |
| 1562 | */ |
| 1563 | mHoldUpdates.store(false, std::memory_order_release); |
| 1564 | } |
| 1565 | } |
| 1566 | |
| 1567 | |
| 1568 | /* alcSetError |
no test coverage detected