Skip to content

Commit

Permalink
KTOR-7299 Fix close race condition causing descriptor to be closed wh…
Browse files Browse the repository at this point in the history
…ile select is still busy
  • Loading branch information
Thomas-Vos committed Jan 31, 2025
1 parent 55106bc commit 9b23adc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ internal actual class SelectorHelper {

actual fun requestTermination() {
interestQueue.close()
closeQueue.close()
wakeupSignal.signal()
}

private fun cleanup() {
closeQueue.close()
while (true) {
val event = closeQueue.removeFirstOrNull() ?: break
closeDescriptor(event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ internal actual class SelectorHelper {

actual fun requestTermination() {
interestQueue.close()
closeQueue.close()
wakeupSignal.signal()
}

private fun cleanup() {
closeQueue.close()
while (true) {
val event = closeQueue.removeFirstOrNull() ?: break
closeDescriptor(event)
Expand Down

0 comments on commit 9b23adc

Please sign in to comment.