Skip to content

macOS/iOS: Implement wake-ups using system mechanisms#4146

Merged
madsmtm merged 2 commits intomasterfrom
madsmtm/apple-proper-wakeup
Mar 1, 2025
Merged

macOS/iOS: Implement wake-ups using system mechanisms#4146
madsmtm merged 2 commits intomasterfrom
madsmtm/apple-proper-wakeup

Conversation

@madsmtm
Copy link
Copy Markdown
Member

@madsmtm madsmtm commented Feb 26, 2025

Setting an atomic in wake_up and relying on it being propagated by the time the run loop wakes up is brittle, the proper way of using CFRunLoopSource is to do your work inside the perform callback. This also automatically handles coalescing multiple events, and frees us from having to manually check an atomic on each iteration of the run loop.

Part of #1029.

@madsmtm madsmtm added S - enhancement Wouldn't this be the coolest? DS - appkit Affects the AppKit/macOS backend DS - uikit Affects the UIKit backend (iOS, tvOS, watchOS, visionOS) labels Feb 26, 2025
@madsmtm madsmtm changed the title macOS/iOS: Implement wake-ups using CF mechanisms macOS/iOS: Implement wake-ups using system mechanisms Feb 26, 2025
@madsmtm madsmtm force-pushed the madsmtm/apple-proper-wakeup branch 2 times, most recently from 5732d82 to 3217bc1 Compare February 27, 2025 00:52
Comment thread src/platform_impl/apple/event_loop_proxy.rs
Comment thread src/application.rs Outdated
@madsmtm madsmtm force-pushed the madsmtm/apple-proper-wakeup branch from 3217bc1 to fde5fb5 Compare March 1, 2025 11:54
@madsmtm madsmtm requested a review from kchibisov March 1, 2025 11:55
@kchibisov

This comment was marked as off-topic.

@madsmtm
Copy link
Copy Markdown
Member Author

madsmtm commented Mar 1, 2025

Moved your comment to #4149.

@madsmtm madsmtm merged commit 39c0862 into master Mar 1, 2025
@madsmtm madsmtm deleted the madsmtm/apple-proper-wakeup branch March 1, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - appkit Affects the AppKit/macOS backend DS - uikit Affects the UIKit backend (iOS, tvOS, watchOS, visionOS) S - enhancement Wouldn't this be the coolest?

Development

Successfully merging this pull request may close these issues.

2 participants