We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9881574 commit b231835Copy full SHA for b231835
library/std/src/sys/unix/locks/pthread_mutex.rs
@@ -64,7 +64,7 @@ impl LazyInit for AllocatedMutex {
64
// We're not allowed to pthread_mutex_destroy a locked mutex,
65
// so check first if it's unlocked.
66
if unsafe { libc::pthread_mutex_trylock(mutex.0.get()) == 0 } {
67
- unsafe { libc::pthread_mutex_destroy(mutex.0.get()) };
+ unsafe { libc::pthread_mutex_unlock(mutex.0.get()) };
68
drop(mutex);
69
} else {
70
// The mutex is locked. This happens if a MutexGuard is leaked.
0 commit comments