struct tor_mutex_t {
HANDLE handle;
};
-tor_mutex_t *tor_mutex_new(void)
+tor_mutex_t *tor_mutex_new(void)
{
tor_mutex_t *m;
m = tor_malloc_zero(sizeof(tor_mutex_t));
r = WaitForSingleObject(m->handle, INFINITE);
switch (r) {
case WAIT_ABANDONED: /* holding thread exited. */
- case WAIT_OBJECT_0: /* we got the mutex normally. */
+ case WAIT_OBJECT_0: /* we got the mutex normally. */
break;
case WAIT_TIMEOUT: /* Should never happen. */
- tor_assert(0);
+ tor_assert(0);
break;
- case WAIT_FAILED:
+ case WAIT_FAILED:
log_fn(LOG_WARN, "Failed to acquire mutex: %d", GetLastError());
}
}
BOOL r;
r = ReleaseMutex(m->handle);
if (!r) {
- log_fn(LOG_WARN, "Failed to release mutex: %d", GetLastError());
+ log_fn(LOG_WARN, "Failed to release mutex: %d", GetLastError());
}
}
tor_mutex_acquire(key_lock);
*key = crypto_pk_dup_key(onionkey);
if (lastonionkey)
- *last = crypto_pk_dup_key(lastonionkey);
+ *last = crypto_pk_dup_key(lastonionkey);
else
*last = NULL;
tor_mutex_release(key_lock);
crypto_pk_env_t *prkey;
if (!key_lock)
- key_lock = tor_mutex_new();
+ key_lock = tor_mutex_new();
/* OP's don't need keys. Just initialize the TLS context.*/
if (!options.ORPort) {