Anonymous - 2012-07-03

Is this problem can be solved used next concept?:
event_base_loop() {
lock(mutex);
while (...) {
dispatch(base);
c = get_callback(ev);
unlock(mutex);
do_callback( c );
lock(mutex);
}
unlock(mutex);
}

Mutex guarantee that dispatch be called by one thread, but functions callback can work in multiple threads.
I can wrote this patch.

 

Last edit: Anonymous 2014-10-13