Watch a data link source with whatever the platform provides - #908
Open
DTW-Thalion wants to merge 1 commit into
Open
Watch a data link source with whatever the platform provides#908DTW-Thalion wants to merge 1 commit into
DTW-Thalion wants to merge 1 commit into
Conversation
DTW-Thalion
force-pushed
the
fix/datalink-monitor-portable
branch
2 times, most recently
from
August 11, 2026 20:42
849958e to
3462e72
Compare
NSDataLinkManager watched source files with inotify, which only Linux has. Everywhere else the manager still built and still accepted links, so nothing reported that monitoring was not running: the delegate was never asked and a link never refreshed. On Windows a change notification handle watches the directory a source file is in, and every link taking its source from there is reported. The notification is the platform saying something in that directory changed, and no modification date is consulted to confirm it, since an edit made in the same second as the reading before it leaves the date alone and the delegate exists to decide whether the change matters. Where there is neither mechanism, and where a native one cannot be started, a timer compares each source file modification date and size. The size is compared as well as the date for the same reason. All three end at one private method that runs on the main thread, so the delegate is still never messaged from the monitoring thread. Tests/gui/NSDataLink on MSYS2 UCRT64, the platform of the Windows MinGW job: sourceMonitoring.m line 98 failed before, and 101 assertions pass after, the delegate being asked 106ms after the write rather than not at all. On Linux the set gives 101 passed before and after, run against the built library rather than the installed one.
DTW-Thalion
force-pushed
the
fix/datalink-monitor-portable
branch
from
August 12, 2026 10:57
3462e72 to
49fc3ed
Compare
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.
Fixes #898.
NSDataLinkManager watched source files with inotify, which only Linux has. Everywhere else the manager still built and still accepted links, so nothing reported that monitoring was not running: the delegate was never asked and a link never refreshed.
On Windows a change notification handle watches the directory a source file is in, and every link taking its source from there is reported. No modification date is consulted to confirm it, since an edit made in the same second as the reading before it leaves the date alone, and the delegate exists to decide whether the change matters.
Where there is neither, or a native one cannot start, a timer compares each source file's modification date and size.
All three end at one private method that runs on the main thread, so the delegate is still never messaged from the monitoring thread.
Tests/gui/NSDataLink on MSYS2 UCRT64, the platform of the Windows MinGW job: sourceMonitoring.m:98 failed before and 101 assertions pass after, the delegate asked 106ms after the write. On Linux the set gives 101 passed before and after, against the built library rather than the installed one.