[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] locking / termination callback



Hi Nick and friends,

just a question and an idea:

1. locking

assuming event_base supports and has a lock, is there an API to expose that particular lock towards the application? In some situations, it would help to avoid complex designs by sharing the lock.
API could be like "int event_base_lock(event_base *)", "int event_base_trylock(event_base *)", "int event_base_unlock(event_base *)".


2. termination callback

What do you think about
  • adding a flag EV_TERM to the EV_XX flags
  • trigger a callback into active "event listeners", having the what-flag set to EV_TERM once the event base gets either destroyed or halted via event_base_loopbreak
This would be extremly helpful to clean up pending things in applications, providing some sort of broadcast notification for all event receivers.

Thanks and cheers,
  Roman