Skip to content

Commit 4b086d4

Browse files
committed
expect EINVAL for pthread_mutex_destroy for aix
1 parent 34a5ea9 commit 4b086d4

File tree

1 file changed

+3
-3
lines changed
  • library/std/src/sys/pal/unix/sync

1 file changed

+3
-3
lines changed

library/std/src/sys/pal/unix/sync/mutex.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ impl Drop for Mutex {
111111
// `PTHREAD_MUTEX_INITIALIZER`, which is valid at all locations. Thus,
112112
// this call always destroys a valid mutex.
113113
let r = unsafe { libc::pthread_mutex_destroy(self.raw()) };
114-
if cfg!(target_os = "dragonfly") {
115-
// On DragonFly pthread_mutex_destroy() returns EINVAL if called on a
116-
// mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER.
114+
if cfg!(any(target_os = "aix", target_os = "dragonfly")) {
115+
// On AIX and DragonFly pthread_mutex_destroy() returns EINVAL if called
116+
// on a mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER.
117117
// Once it is used (locked/unlocked) or pthread_mutex_init() is called,
118118
// this behaviour no longer occurs.
119119
debug_assert!(r == 0 || r == libc::EINVAL);

0 commit comments

Comments
 (0)