mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-17 00:07:47 +00:00
Fixed logger thread timing logic
This commit is contained in:
parent
b2f86a5f6b
commit
a78ddb50d5
1 changed files with 5 additions and 2 deletions
|
@ -152,10 +152,13 @@ private:
|
|||
|
||||
do {
|
||||
uv_mutex_lock(&m_mutex);
|
||||
uv_cond_wait(&m_cond, &m_mutex);
|
||||
if (m_readPos == m_writePos.load()) {
|
||||
// Nothing to do, wait for the signal
|
||||
uv_cond_wait(&m_cond, &m_mutex);
|
||||
}
|
||||
uv_mutex_unlock(&m_mutex);
|
||||
|
||||
for (uint32_t writePos = m_writePos.load(); m_readPos < writePos; writePos = m_writePos.load()) {
|
||||
for (uint32_t writePos = m_writePos.load(); m_readPos != writePos; writePos = m_writePos.load()) {
|
||||
// We have at least one log slot pending, possibly more than one
|
||||
// Process everything in a loop before reading m_writePos again
|
||||
do {
|
||||
|
|
Loading…
Reference in a new issue