File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Version 0.5.8
2
+
3
+ - Fix race condition in unbounded channel. (#972 )
4
+
1
5
# Version 0.5.7
2
6
7
+ ** Note:** This release has been yanked due to bug fixed in 0.5.8.
8
+
3
9
- Improve handling of very large timeout. (#953 )
4
10
5
11
# Version 0.5.6
6
12
13
+ ** Note:** This release has been yanked due to bug fixed in 0.5.8.
14
+
7
15
- Bump the minimum supported Rust version to 1.38. (#877 )
8
16
9
17
# Version 0.5.5
10
18
19
+ ** Note:** This release has been yanked due to bug fixed in 0.5.8.
20
+
11
21
- Replace Spinlock with Mutex. (#835 )
12
22
13
23
# Version 0.5.4
14
24
25
+ ** Note:** This release has been yanked due to bug fixed in 0.5.8.
26
+
15
27
- Workaround a bug in upstream related to TLS access on AArch64 Linux. (#802 )
16
28
17
29
# Version 0.5.3
28
40
29
41
# Version 0.5.1
30
42
43
+ ** Note:** This release has been yanked due to bug fixed in 0.5.8.
44
+
31
45
- Fix memory leak in unbounded channel. (#669 )
32
46
33
47
# Version 0.5.0
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ name = "crossbeam-channel"
4
4
# - Update CHANGELOG.md
5
5
# - Update README.md
6
6
# - Create "crossbeam-channel-X.Y.Z" git tag
7
- version = " 0.5.7 "
7
+ version = " 0.5.8 "
8
8
edition = " 2018"
9
9
rust-version = " 1.38"
10
10
license = " MIT OR Apache-2.0"
Original file line number Diff line number Diff line change @@ -584,6 +584,17 @@ impl<T> Channel<T> {
584
584
let mut head = self . head . index . load ( Ordering :: Acquire ) ;
585
585
let mut block = self . head . block . load ( Ordering :: Acquire ) ;
586
586
587
+ // If we're going to be dropping messages we need to synchronize with initialization
588
+ if head >> SHIFT != tail >> SHIFT {
589
+ // The block can be null here only if a sender is in the process of initializing the
590
+ // channel while another sender managed to send a message by inserting it into the
591
+ // semi-initialized channel and advanced the tail.
592
+ // In that case, just wait until it gets initialized.
593
+ while block. is_null ( ) {
594
+ backoff. snooze ( ) ;
595
+ block = self . head . block . load ( Ordering :: Acquire ) ;
596
+ }
597
+ }
587
598
unsafe {
588
599
// Drop all messages between head and tail and deallocate the heap-allocated blocks.
589
600
while head >> SHIFT != tail >> SHIFT {
You can’t perform that action at this time.
0 commit comments