Skip to content

Commit 700ea22

Browse files
committed
Impl Send+Sync for CFRunLoopTimer, CFRunLoopSource, CFRunLoopObserver
Following #610, the same reasoning from #550 applies to the remaining CFRunLoop types.
1 parent 6541d9a commit 700ea22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core-foundation/src/runloop.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ impl CFRunLoop {
146146
declare_TCFType!(CFRunLoopTimer, CFRunLoopTimerRef);
147147
impl_TCFType!(CFRunLoopTimer, CFRunLoopTimerRef, CFRunLoopTimerGetTypeID);
148148

149+
unsafe impl Send for CFRunLoopTimer {}
150+
unsafe impl Sync for CFRunLoopTimer {}
151+
149152
impl CFRunLoopTimer {
150153
pub fn new(
151154
fireDate: CFAbsoluteTime,
@@ -177,6 +180,9 @@ impl_TCFType!(
177180
CFRunLoopSourceGetTypeID
178181
);
179182

183+
unsafe impl Send for CFRunLoopSource {}
184+
unsafe impl Sync for CFRunLoopSource {}
185+
180186
impl CFRunLoopSource {
181187
pub fn from_file_descriptor(fd: &CFFileDescriptor, order: CFIndex) -> Option<CFRunLoopSource> {
182188
fd.to_run_loop_source(order)
@@ -190,6 +196,9 @@ impl_TCFType!(
190196
CFRunLoopObserverGetTypeID
191197
);
192198

199+
unsafe impl Send for CFRunLoopObserver {}
200+
unsafe impl Sync for CFRunLoopObserver {}
201+
193202
#[cfg(test)]
194203
mod test {
195204
use super::*;

0 commit comments

Comments
 (0)