allow to have listening state TRUE while sending singal ourself
This commit is contained in:
@@ -315,6 +315,13 @@ static void vsignal(private_bus_t *this, signal_t signal, level_t level,
|
||||
iterator = this->active_listeners->create_iterator(this->active_listeners, TRUE);
|
||||
while (iterator->iterate(iterator, (void**)&active_listener))
|
||||
{
|
||||
/* if the thread raising the signal is the same as the one that
|
||||
* listens, we skip it. Otherwise we have a deadlock */
|
||||
if (active_listener->id == pthread_self())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* wait until it is back */
|
||||
while (active_listener->state == REGISTERED)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user