Skip to content

Commit 9643940

Browse files
raphlinusxarvic
authored andcommitted
impl Sync for IdleHandle
Make IdleHandle implement the Sync bound on all platforms. This is required to wrap IdleHandle in any Arc, motivated in particular by ArcWaker which is in turn motivated by async Xilem experiments (see linebender#2184)
1 parent 6d5854a commit 9643940

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

druid-shell/src/backend/mac/window.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ unsafe impl HasRawWindowHandle for WindowHandle {
14241424
}
14251425

14261426
unsafe impl Send for IdleHandle {}
1427+
unsafe impl Sync for IdleHandle {}
14271428

14281429
impl IdleHandle {
14291430
fn add_idle(&self, idle: IdleKind) {

druid-shell/src/backend/web/window.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ impl WindowHandle {
688688
}
689689

690690
unsafe impl Send for IdleHandle {}
691+
unsafe impl Sync for IdleHandle {}
691692

692693
impl IdleHandle {
693694
/// Add an idle handler, which is called (once) when the main thread is idle.

druid-shell/src/backend/windows/window.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,7 @@ impl WindowHandle {
22362236

22372237
// There is a tiny risk of things going wrong when hwnd is sent across threads.
22382238
unsafe impl Send for IdleHandle {}
2239+
unsafe impl Sync for IdleHandle {}
22392240

22402241
impl IdleHandle {
22412242
/// Add an idle handler, which is called (once) when the message loop

0 commit comments

Comments
 (0)