From a7a79f28a8fe288ec92593835583160f455707ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 9 Jan 2020 21:06:11 +0100 Subject: 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. --- tokio/src/task/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tokio/src/task') 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() -- cgit v1.2.3