Repository navigation
fix(libkernel): read the condition clock through a non-const atomic_ref - #15109
Merged
oneandonlydean merged 1 commit intoNov 3, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
ConditionDeadline read clockId through std::atomic_ref<const std::uint32_t>, which libc++ does not support yet (atomic_ref of a const type is C++26), so SyncOnAddress.cpp stopped compiling on macOS. Its only caller passes a mutable UserCondition, so the parameter drops const and the read uses std::atomic_ref<std::uint32_t> like the other fields in the file.
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.
What
ConditionDeadlineinSyncOnAddress.cpp(from 6f6c18b) reads the condition'sclockIdthroughstd::atomic_ref<const std::uint32_t>.atomic_refof a const type is a C++26 addition that libc++ doesn't implement yet, so the file stops compiling on macOS (atomic_ref.h:151: cannot initialize a parameter of type 'unsigned int *' with an lvalue of type 'const unsigned int *'). libstdc++ accepts it, which is why Linux and MinGW build.Its only caller,
ConditionWait, already passes a mutableUserCondition*. So the parameter dropsconst, and the read usesstd::atomic_ref<std::uint32_t>like the other fields in the file. The load is the same.Tested
macOS 27.2, Apple M4 Pro, Apple clang 21, x86-64 Release (Rosetta 2).
maindoesn't build the libraries on macOS by itself, so the tree ismainb28bb77217+ the open macOS PRs #11554, #7631, #7804, #4630, #14883 and #15002, plus this commit:SyncOnAddress.cppand the fullcmake --build/--target libscompile;ctest -R 'umtx|guest_cond_timedwait|guest_ult_condition|guest_ult_sync_rwlock': 14 of 14 pass, includingguest_umtx_op, whose absoluteCLOCK_MONOTONICwaits go through this read.Not run on Linux or Windows; the change there is the same load through a non-const reference.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)