Bas Verhoeven wrote:
> Hello again,
>
> I'm currently working with libevent 2.02-alpha and I encountered a weird 
> problem when I try to exit the base loop from another thread.
>
>   
I seem to have found a workaround for this problem now.

Instead of using 'event_base_dispatch(base)' I am now using 
'event_base_loop(base, EVLOOP_NONBLOCK)' in a while(!shutdown) loop. 
This seems to work fine: the thread shuts down instantly and libevent 
cleans up.

I also tried experimenting with the 'EVLOOP_ONCE' flag but then I 
encountered the same problem as when using no flags at all: libevent 
never really quits the loop, and I don't really get why it does that.

I seem to be able to continue with this workaround, but I doubt that 
it's the best way to handle this.  So, if anyone has any suggestions on 
how to handle this differently, then please let me know.


_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to