summaryrefslogtreecommitdiffstats
path: root/tokio/src/task
diff options
context:
space:
mode:
authorTomasz Miąsko <tomaszmiasko@gmail.com>2020-01-09 21:06:11 +0100
committerCarl Lerche <me@carllerche.com>2020-01-09 12:06:11 -0800
commita7a79f28a8fe288ec92593835583160f455707ad (patch)
treecf0a7b0432ba0e1380b5c4a070cf43489087e890 /tokio/src/task
parentbd28a7a767692f84c4dd0a78556ba5cb76d258e5 (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/task')
-rw-r--r--tokio/src/task/state.rs2
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()