Commit ad68c06
Sergey Mashkov
IO: eliminate race in close
I knew that I'll hit this bug anyway. Here we MUST flush twice as
flush at read suspend is not enough. If a writer closes then the first
flush does flush and it closes so all readers will see all pending data.
If a foreign thread does close then the first flush is makes no
difference however the second is required for proper cleanup and
to do tryTerminate1 parent ccf8dde commit ad68c06
File tree
1 file changed
+1
-0
lines changed- core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io
1 file changed
+1
-0
lines changedcore/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io/ByteBufferChannel.kt
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
0 commit comments