diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/os_win/os_mtx_cond.c')
-rw-r--r-- | src/third_party/wiredtiger/src/os_win/os_mtx_cond.c | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c b/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c index 8645fdaccb3..27207d289a6 100644 --- a/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c +++ b/src/third_party/wiredtiger/src/os_win/os_mtx_cond.c @@ -18,10 +18,6 @@ __wt_cond_alloc(WT_SESSION_IMPL *session, { WT_CONDVAR *cond; - /* - * !!! - * This function MUST handle a NULL session handle. - */ WT_RET(__wt_calloc_one(session, &cond)); InitializeCriticalSection(&cond->mtx); @@ -38,10 +34,10 @@ __wt_cond_alloc(WT_SESSION_IMPL *session, /* * __wt_cond_wait_signal -- - * Wait on a mutex, optionally timing out. If we get it - * before the time out period expires, let the caller know. + * Wait on a mutex, optionally timing out. If we get it before the time + * out period expires, let the caller know. */ -int +void __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, bool *signalled) { @@ -55,17 +51,10 @@ __wt_cond_wait_signal( /* Fast path if already signalled. */ *signalled = true; if (__wt_atomic_addi32(&cond->waiters, 1) == 0) - return (0); + return; - /* - * !!! - * This function MUST handle a NULL session handle. - */ - if (session != NULL) { - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "wait %s cond (%p)", cond->name, cond)); - WT_STAT_FAST_CONN_INCR(session, cond_wait); - } + __wt_verbose(session, WT_VERB_MUTEX, "wait %s", cond->name); + WT_STAT_FAST_CONN_INCR(session, cond_wait); EnterCriticalSection(&cond->mtx); locked = true; @@ -112,18 +101,19 @@ __wt_cond_wait_signal( LeaveCriticalSection(&cond->mtx); if (sleepret != 0) - return (0); + return; - __wt_errx(session, "SleepConditionVariableCS: %s", - __wt_formatmessage(session, windows_error)); - return (__wt_map_windows_error(windows_error)); + __wt_errx(session, "SleepConditionVariableCS: %s: %s", + cond->name, __wt_formatmessage(session, windows_error)); + WT_PANIC_MSG(session, __wt_map_windows_error(windows_error), + "SleepConditionVariableCS: %s", cond->name); } /* * __wt_cond_signal -- * Signal a waiting thread. */ -int +void __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) { WT_DECL_RET; @@ -131,17 +121,11 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) locked = false; - /* - * !!! - * This function MUST handle a NULL session handle. - */ - if (session != NULL) - WT_RET(__wt_verbose(session, WT_VERB_MUTEX, - "signal %s cond (%p)", cond->name, cond)); + __wt_verbose(session, WT_VERB_MUTEX, "signal %s", cond->name); /* Fast path if already signalled. */ if (cond->waiters == -1) - return (0); + return; if (cond->waiters > 0 || !__wt_atomic_casi32(&cond->waiters, 0, -1)) { EnterCriticalSection(&cond->mtx); @@ -152,8 +136,9 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) if (locked) LeaveCriticalSection(&cond->mtx); if (ret == 0) - return (0); - WT_RET_MSG(session, ret, "WakeAllConditionVariable"); + return; + + WT_PANIC_MSG(session, ret, "WakeAllConditionVariable: %s", cond->name); } /* |