diff options
author | Tomasz Miąsko <tomaszmiasko@gmail.com> | 2020-01-09 21:06:11 +0100 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2020-01-09 12:06:11 -0800 |
commit | a7a79f28a8fe288ec92593835583160f455707ad (patch) | |
tree | cf0a7b0432ba0e1380b5c4a070cf43489087e890 /tokio/src | |
parent | bd28a7a767692f84c4dd0a78556ba5cb76d258e5 (diff) |
rt: use release ordering in `drop_join_handle_fast` (#2044)
Previously acquire operations reading a value written by a successful
CAS in `drop_join_handle_fast` did not synchronize with it. The CAS
wasn't guaranteed to happen before the task deallocation, and so
created a data race between the two.
Use release success ordering to ensure synchronization.
Diffstat (limited to 'tokio/src')
-rw-r--r-- | tokio/src/task/state.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/task/state.rs b/tokio/src/task/state.rs index dadfe540..b764167e 100644 --- a/tokio/src/task/state.rs +++ b/tokio/src/task/state.rs @@ -266,7 +266,7 @@ impl State { .compare_exchange_weak( INITIAL_STATE | JOIN_INTEREST, INITIAL_STATE, - Relaxed, + Release, Relaxed, ) .is_ok() |