diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-06-21 12:26:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-06-21 12:26:21 -0400 |
commit | 215e629cd4244f40769e09df5951c6cbe66ed246 (patch) | |
tree | cae12f115b71b0b589aa7842efaab8b3060048ee /include | |
parent | 7b259b6796fc34948402805e88184c29400db159 (diff) | |
download | libevent-215e629cd4244f40769e09df5951c6cbe66ed246.tar.gz |
Add bufferevent_lock()/bufferevent_unlock()
Although bufferevent operations are threadsafe, sometimes you need
to make sure that a few operations on a single bufferevent will all
be executed with nothing intervening. That's what these functions
are for.
Diffstat (limited to 'include')
-rw-r--r-- | include/event2/bufferevent.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/event2/bufferevent.h b/include/event2/bufferevent.h index 02cabe67..55e44f9c 100644 --- a/include/event2/bufferevent.h +++ b/include/event2/bufferevent.h @@ -424,6 +424,18 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events, size_t lowmark, size_t highmark); /** + Acquire the lock on a bufferevent. Has no effect if locking was not + enabled with BEV_OPT_THREADSAFE. + */ +void bufferevent_lock(struct bufferevent *bufev); + +/** + Release the lock on a bufferevent. Has no effect if locking was not + enabled with BEV_OPT_THREADSAFE. + */ +void bufferevent_unlock(struct bufferevent *bufev); + +/** Flags that can be passed into filters to let them know how to deal with the incoming data. */ |