diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-04-09 18:16:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-04-26 12:18:07 -0400 |
commit | 02fbf68770d3dcb864c867124e159b3680036206 (patch) | |
tree | 8d0b931b5f2f6c95386654c9bf3329b80df9c191 /evbuffer-internal.h | |
parent | 9d893c97fa8796e312731f2d0ac0d0336deffdc0 (diff) | |
download | libevent-02fbf68770d3dcb864c867124e159b3680036206.tar.gz |
Use finalization feature so bufferevents can avoid deadlocks
Since the bufferevents' events are now EV_FINALIZE (name pending),
they won't deadlock. To clean up properly, though, we must use the
finalization feature.
This patch also split bufferevent deallocation into an "unlink" step
that happens fast, and a "destruct" step that happens after
finalization.
More work is needed: there needs to be a way to specify a finalizer
for the bufferevent's argument itself. Also, this finalizer business
makes lots of the reference counting we were doing unnecessary.
Also, more testing is needed.
Diffstat (limited to 'evbuffer-internal.h')
-rw-r--r-- | evbuffer-internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/evbuffer-internal.h b/evbuffer-internal.h index 91124338..fb67ec09 100644 --- a/evbuffer-internal.h +++ b/evbuffer-internal.h @@ -327,6 +327,11 @@ void evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev); void evbuffer_invoke_callbacks_(struct evbuffer *buf); + +int evbuffer_get_callbacks_(struct evbuffer *buffer, + struct event_callback **cbs, + int max_cbs); + #ifdef __cplusplus } #endif |