Skip to content

Commit 6a435a3

Browse files
committed
Linux Platform: fix the dispatch thread
In fact since a40af2f an old bug is now visible resulting in a 100% cpu usage. In case we exit the wait, if there is nothing in the queue, we must not release the lock as we are waiting again immediatelly.
1 parent fc94c51 commit 6a435a3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/platform/linux/platform.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ static void * dispatch_indication(void * unused)
115115
// Check if we wake up but nothing in queue
116116
if (m_queue_empty)
117117
{
118-
// Release the lock
119-
pthread_mutex_unlock(&m_queue_mutex);
120118
// Continue to evaluate the stop condition
121119
continue;
122120
}
@@ -245,7 +243,7 @@ static void * poll_for_indication(void * unused)
245243
free_buffer_room = m_ind_queue_read - m_ind_queue_write;
246244
}
247245
}
248-
246+
249247
if (m_polling_thread_state_request == POLLING_THREAD_STOP_REQUESTED)
250248
{
251249
// In case we are about to stop, let's poll only one by one to have more chance to

0 commit comments

Comments
 (0)