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 (#4638)
  • Loading branch information
Thomas-Vos authored Jan 31, 2025
1 parent 55106bc commit 255ce5e
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 255ce5e

Please sign in to comment.