Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Referring to scylladb#1323 and discussion in scylladb#1477. Avi Kivity <[email protected]> asserted that: > We have a choice: > declare that most things can be movable and live with the complication and slowdown > declare that control structures (like semaphores) have stable addresses (as they typically do anyway) > There's really no reason to move a sempahore. Gleb Natapov <[email protected]> proposed: > add an assertion in debug mode if a semaphore is moved after the first use. It can be a simple bool that is set to true on the first wait(). Since we still need to be able to move the semaphore after it created this patch adds a `used_flag` class that asserts that it isn't used when moved or move-assigned. This patch reverts commit 3061b2f but keeps the unit test introduced by it. Close scylladb#1323 Signed-off-by: Benny Halevy <[email protected]>
- Loading branch information