Repository navigation
0.18.2: the stop word wakes a context waiting upon it - #41
Merged
Merged
Conversation
…x, as kal_task_wait waits) Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stop handler woke the stop word as a shared futex (
FUTEX_WAKE), andkal_task_waitwaits on it as a private one (FUTEX_WAIT | FUTEX_PRIVATE_FLAG). The kernel keys the two apart, so a context waiting upon the word with no bound was never woken by a request: a program that ends at a request by waiting for it (mcpplibs.osinterrupt::wait, mcpp's watcher) never ended. Measured in mcpp: SIGINT during a build with a four-second action had no effect, and the build finished with status 0.The handler now wakes with
FUTEX_WAKE | FUTEX_PRIVATE_FLAG, the operationkal_task_wakeperforms.tests/stop_word_take_over.cppgains the case: a context waits upon the word withkal_task_wait(word, 0, 0)and the program sends itself SIGTERM; the context is woken within two seconds. The case fails on 0.18.1.openkal-macos waits and wakes the word with the same
UL_COMPARE_AND_WAIToperation and openkal-windows withWaitOnAddress/WakeByAddressAll; neither has this defect.Co-authored-by: speak-agent 248744407+speak-agent@users.noreply.github.com