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

[Libevent-users] shutdown behavior of bufferevents



Hi,

I am trying to understand the invariants the libevent library provides when we free its resources. 

Specifically, if I call bufferevent_free(my_bev) in a thread different from the main event_loop thread, is it guaranteed that my_bev's callbacks will never run after bufferevent_free call completes?

Moreover, if the callbacks were running during the call to bufferevent_free(), is it guaranteed that they finished to run as well? Does BEV_OPT_UNLOCK_CALLBACKS affect this behavior?

Note that I do not use BEV_OPT_DEFER_CALLBACKS flag.

I am using 2.0.19-stable version of libevent library. 


Thanks!