Revise the locking API: deprecate the old locking callbacks and add trylock.
authorNick Mathewson <nickm@torproject.org>
Fri, 27 Nov 2009 20:20:43 +0000 (15:20 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 27 Nov 2009 22:36:24 +0000 (17:36 -0500)
commit347952ffe0039369ff4e7c94c4e27e7333ba8ecb
tree51a3147fc57fdfa8290ba880f01068a26f626394
parente1ffbb82e34d786d07a5acdb16077f6526f610c3
Revise the locking API: deprecate the old locking callbacks and add trylock.

Previously, there was no good way to request different kinds of lock
(say, read/write vs writeonly or recursive vs nonrecursive), or for a
lock function to signal failure (which would be important for a
trylock mode).

This patch revises the lock API to be a bit more useful.  The older
lock calls are still supported for now.

We also add a debugging mode to catch common errors in using the
locking APIs.
12 files changed:
Makefile.am
buffer.c
bufferevent.c
defer-internal.h
evdns.c
event.c
evthread-internal.h
evthread.c [new file with mode: 0644]
evthread_pthread.c
evthread_win32.c
include/event2/thread.h
test/regress_main.c