diff options
| author | Henry Jiang <henry.jiang1@ibm.com> | 2025-02-12 00:54:00 -0500 |
|---|---|---|
| committer | Henry Jiang <henry.jiang1@ibm.com> | 2025-02-12 00:54:00 -0500 |
| commit | 4b086d47118668bff5f04b511e673fa3c84369d3 (patch) | |
| tree | 3deb344e5aeb8836cd528ace814bccd1667d3ea8 /library/std/src/sys | |
| parent | 34a5ea911c56e79bd451c63f04ea2f5023d7d1a3 (diff) | |
expect EINVAL for pthread_mutex_destroy for aix
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/pal/unix/sync/mutex.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/unix/sync/mutex.rs b/library/std/src/sys/pal/unix/sync/mutex.rs index 8ff6c3d3d15..557e70af94b 100644 --- a/library/std/src/sys/pal/unix/sync/mutex.rs +++ b/library/std/src/sys/pal/unix/sync/mutex.rs @@ -111,9 +111,9 @@ impl Drop for Mutex { // `PTHREAD_MUTEX_INITIALIZER`, which is valid at all locations. Thus, // this call always destroys a valid mutex. let r = unsafe { libc::pthread_mutex_destroy(self.raw()) }; - if cfg!(target_os = "dragonfly") { - // On DragonFly pthread_mutex_destroy() returns EINVAL if called on a - // mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER. + if cfg!(any(target_os = "aix", target_os = "dragonfly")) { + // On AIX and DragonFly pthread_mutex_destroy() returns EINVAL if called + // on a mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER. // Once it is used (locked/unlocked) or pthread_mutex_init() is called, // this behaviour no longer occurs. debug_assert!(r == 0 || r == libc::EINVAL); |
