aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-07-01 16:22:45 +0000
committerNick Mathewson <nickm@torproject.org>2007-07-01 16:22:45 +0000
commit1bdcfd92033d85d747ddc6fe85f986edba3f43b3 (patch)
tree9dedf2eef0830a05b4adc8151cf1a331a109ac9c /src/common/compat.h
parent8bebff3deb8a71a2b31f3cbfa2b686d4b25c9e76 (diff)
downloadtor-1bdcfd92033d85d747ddc6fe85f986edba3f43b3.tar.gz
tor-1bdcfd92033d85d747ddc6fe85f986edba3f43b3.zip
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
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h10
1 files changed, 10 insertions, 0 deletions
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);