From 1bdcfd92033d85d747ddc6fe85f986edba3f43b3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 1 Jul 2007 16:22:45 +0000 Subject: r13570@catbus: nickm | 2007-06-30 20:41:05 -0400 Implement conditions in compat.c; switch windows to use "critical sections" instead of mutexes. Apparently, mutexes are for IPC and critical sections are for multithreaded. svn:r10716 --- src/common/compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/common/compat.h') diff --git a/src/common/compat.h b/src/common/compat.h index fe07d3254b..121683fcdb 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -360,6 +360,16 @@ unsigned long tor_get_thread_id(void); #define tor_get_thread_id() (1UL) #endif +#ifdef TOR_IS_MULTITHREADED +typedef struct tor_cond_t tor_cond_t; +tor_cond_t *tor_cond_new(void); +void tor_conf_free(tor_cond_t *cond); +int tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex); +void tor_cond_signal_one(tor_cond_t *cond); +void tor_cond_signal_all(tor_cond_t *cond); +void tor_threads_init(void); +#endif + /* Platform-specific helpers. */ #ifdef MS_WINDOWS char *format_win32_error(DWORD err); -- cgit v1.2.3-54-g00ecf