summaryrefslogtreecommitdiff
path: root/bufferevent-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-09 18:16:13 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-26 12:18:07 -0400
commit02fbf68770d3dcb864c867124e159b3680036206 (patch)
tree8d0b931b5f2f6c95386654c9bf3329b80df9c191 /bufferevent-internal.h
parent9d893c97fa8796e312731f2d0ac0d0336deffdc0 (diff)
downloadlibevent-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 'bufferevent-internal.h')
-rw-r--r--bufferevent-internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/bufferevent-internal.h b/bufferevent-internal.h
index 63bf4708..ccfc7045 100644
--- a/bufferevent-internal.h
+++ b/bufferevent-internal.h
@@ -252,8 +252,11 @@ struct bufferevent_ops {
*/
int (*disable)(struct bufferevent *, short);
+ /** DOCUMENT */
+ void (*unlink)(struct bufferevent *);
+
/** Free any storage and deallocate any extra data or structures used
- in this implementation.
+ in this implementation. DOCUMENT
*/
void (*destruct)(struct bufferevent *);