Hello
I have my event callback receiving data from the network using recv. If recv returns 0 (FIN received), I call a function to disconnect and cleanup.
Part of my cleanup is as follows
if (server->receive_event) {
event_free(server->receive_event);
server->receive_event = NULL;
}
I have run into this strange deadlock situation
If the cleanup function is called from the event callback then I experience no deadlocks.
However if the cleanup function is called from another thread, and the event callback is executing, then a deadlock occurs. In my case the event callback also never terminates as it is waiting on a lock acquired by the cleanup function.
Is it normal behavior that event_free won't be able to free the event, if the event is active in another thread?
Thanks
Cheers