Skip to content

Commit 823bd9d

Browse files
Gwendal RaoulGwendalRaoul
authored andcommitted
Linux Platfrom: add comment to clarify indication queue lock
It was not clear why the indication queue is not locked when checking free space. #26
1 parent bb9e1cc commit 823bd9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/platform/linux/platform.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ static void * poll_for_indication(void * unused)
179179
// Get the lock to be able to poll
180180
pthread_mutex_lock(&m_poll_mutex);
181181

182+
// Get the number of free buffers in the indication queue
183+
// Note: No need to lock the queue as only m_ind_queue_read can be updated
184+
// and could still be modified when we release the lock after computing
185+
// the max free space
186+
182187
/* Ask for maximum room in buffer queue and less than MAX */
183188
if (!m_queue_empty && (m_ind_queue_write == m_ind_queue_read))
184189
{

0 commit comments

Comments
 (0)