Skip to content

Commit 2b09c85

Browse files
committed
RunLoop: update timer functions on Windows
Update the signatures for the timer functions to match the current declarations.
1 parent 532bd80 commit 2b09c85

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CoreFoundation/RunLoop.subproj/CFRunLoop.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ DISPATCH_EXPORT void _dispatch_main_queue_callback_4CF(void);
9898
#define _dispatch_get_main_queue_port_4CF _dispatch_get_main_queue_handle_4CF
9999
#define _dispatch_main_queue_callback_4CF(x) _dispatch_main_queue_callback_4CF()
100100

101-
#define AbsoluteTime LARGE_INTEGER
102-
103101
#elif DEPLOYMENT_TARGET_LINUX
104102

105103
#include <dlfcn.h>
@@ -622,7 +620,7 @@ static kern_return_t mk_timer_destroy(HANDLE name) {
622620
return (int)res;
623621
}
624622

625-
static kern_return_t mk_timer_arm(HANDLE name, LARGE_INTEGER expire_time) {
623+
static kern_return_t mk_timer_arm(HANDLE name, uint64_t expire_time) {
626624
LARGE_INTEGER result;
627625
// There is a race we know about here, (timer fire time calculated -> thread suspended -> timer armed == late timer fire), but we don't have a way to avoid it at this time, since the only way to specify an absolute value to the timer is to calculate the relative time first. Fixing that would probably require not using the TSR for timers on Windows.
628626
uint64_t now = mach_absolute_time();
@@ -644,7 +642,7 @@ static kern_return_t mk_timer_arm(HANDLE name, LARGE_INTEGER expire_time) {
644642
return (int)res;
645643
}
646644

647-
static kern_return_t mk_timer_cancel(HANDLE name, LARGE_INTEGER *result_time) {
645+
static kern_return_t mk_timer_cancel(HANDLE name, AbsoluteTime *result_time) {
648646
BOOL res = CancelWaitableTimer(name);
649647
if (!res) {
650648
DWORD err = GetLastError();

0 commit comments

Comments
 (0)