We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa2e9ca commit 986c3adCopy full SHA for 986c3ad
tarantool/src/cbus/sync/std.rs
@@ -19,28 +19,19 @@ impl Thread {
19
fn current() -> Self {
20
Self {
21
inner: thread::current(),
22
- flag: Arc::new(AtomicBool::new(true)),
+ flag: Arc::new(AtomicBool::new(false)),
23
}
24
25
26
fn park(&self) {
27
- if self
28
- .flag
29
- .compare_exchange(true, false, Ordering::AcqRel, Ordering::Acquire)
30
- .is_ok()
31
- {
+ if !self.flag.load(Ordering::Acquire) {
32
thread::park();
33
- };
+ }
34
35
36
fn unpark(&self) {
37
38
39
- .compare_exchange(false, true, Ordering::AcqRel, Ordering::Acquire)
40
41
42
- self.inner.unpark();
43
+ self.flag.store(true, Ordering::Release);
+ self.inner.unpark();
44
45
46
0 commit comments