mirror of https://github.com/OISF/suricata
packetpool: improve thread safety
lock_acquire: Calling pthread_mutex_lock acquires lock PktPoolLockedStack_.mutex. 87 SCMutexLock(&my_pool->return_stack.mutex); CID 1554228: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND) dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock PktPoolLockedStack_.mutex. This can cause a deadlock if the notification happens before the lock is acquired. Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.pull/13518/head
parent
65ff3dfa88
commit
f26f7505db
Loading…
Reference in New Issue