Skip to content

Commit 2b9ee8b

Browse files
joboetRalfJung
andauthored
be even more explicit about what happens when copying os_unfair_lock
Co-authored-by: Ralf Jung <[email protected]>
1 parent d70fd08 commit 2b9ee8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/pass-dep/concurrency/apple-os-unfair-lock.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ fn main() {
1414
libc::os_unfair_lock_assert_not_owner(lock.get());
1515
}
1616

17-
// `os_unfair_lock`s can be moved and leaked, even when locked,
18-
// as long as no operation is occurring on the lock:
17+
// `os_unfair_lock`s can be moved and leaked.
18+
// In the real implementation, even moving it while locked is possible
19+
// (and "forks" the lock, i.e. old and new location have independent wait queues);
20+
// Miri behavior differs here and anyway none of this is documented.
1921
let lock = lock;
2022
let locked = unsafe { libc::os_unfair_lock_trylock(lock.get()) };
2123
assert!(locked);

0 commit comments

Comments
 (0)