diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-06 14:17:30 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-06 14:17:30 +0000 |
commit | 73b4428a8ba5d9253183ee3ceaabf4505f63bc90 (patch) | |
tree | 6396a97925e4732adf816359058b430899b83c32 /src/common | |
parent | bbc7cf86d5cf3a3c488e8218884e570201d8f0b8 (diff) | |
download | tor-73b4428a8ba5d9253183ee3ceaabf4505f63bc90.tar.gz tor-73b4428a8ba5d9253183ee3ceaabf4505f63bc90.zip |
r13631@catbus: nickm | 2007-07-06 10:17:22 -0400
Try to fix win32 build again.
svn:r10750
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 9bd249ad46..7d3572e03f 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -1498,10 +1498,8 @@ struct tor_mutex_t { tor_mutex_t * tor_mutex_new(void) { - void *r; tor_mutex_t *m = tor_malloc_zero(sizeof(tor_mutex_t)); - r = InitializeCriticalSection(&m->mutex); - tor_assert(r != NULL); + InitializeCriticalSection(&m->mutex); return m; } void @@ -1653,10 +1651,7 @@ tor_cond_t * tor_cond_new(void) { tor_cond_t *cond = tor_malloc_zero(sizeof(tor_cond_t)); - if (!InitializeCriticalSection(&cond->mutex)) { - tor_free(cond); - return NULL; - } + InitializeCriticalSection(&cond->mutex); cond->events = smartlist_create(); return cond; } @@ -1669,7 +1664,7 @@ tor_cond_free(tor_cond_t *cond) smartlist_free(cond->events); tor_free(cond); } -void +int tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex) { HANDLE event; @@ -1703,6 +1698,7 @@ tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex) case WAIT_FAILED: log_warn(LD_GENERAL, "Failed to acquire mutex: %d",(int) GetLastError()); } + return 0; } void tor_cond_signal_one(tor_cond_t *cond) @@ -1712,7 +1708,7 @@ tor_cond_signal_one(tor_cond_t *cond) EnterCriticalSection(&cond->mutex); - if ((event = smartlist_pop_last(cond->events)) + if ((event = smartlist_pop_last(cond->events))) SetEvent(event); LeaveCriticalSection(&cond->mutex); |