We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84f37e9 commit 59012f8Copy full SHA for 59012f8
src/sw/redis++/patterns/redlock.cpp
@@ -359,7 +359,12 @@ void RedMutexImpl::unlock() {
359
360
if (!_locked()) {
361
// If `lock` is not called yet, the behavior is undefined.
362
- throw Error("RedMutex is not locked");
+ // throw Error("RedMutex is not locked");
363
+ // If the mutex is not locked, return without throwing exception.
364
+ // Because if the background lock-entending thread fails and resets
365
+ // the mutex, i.e. unlocks it, we'll throw exception in unlock, which
366
+ // might cause std::terminate. Check issue #659 for detail.
367
+ return;
368
}
369
370
try {
0 commit comments