Skip to content

Commit 6c3812a

Browse files
mustarttgitbot
authored and
gitbot
committed
expect EINVAL for pthread_mutex_destroy for aix
1 parent 1928fc4 commit 6c3812a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: 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)