Skip to content

Commit 108d752

Browse files
committed
RunLoop: update timer functions on Windows
Update the signatures for the timer functions to match the current declarations.
1 parent f24b6ce commit 108d752

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>
@@ -606,7 +604,7 @@ static kern_return_t mk_timer_destroy(HANDLE name) {
606604
return (int)res;
607605
}
608606

609-
static kern_return_t mk_timer_arm(HANDLE name, LARGE_INTEGER expire_time) {
607+
static kern_return_t mk_timer_arm(HANDLE name, uint64_t expire_time) {
610608
LARGE_INTEGER result;
611609
// 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.
612610
uint64_t now = mach_absolute_time();
@@ -628,7 +626,7 @@ static kern_return_t mk_timer_arm(HANDLE name, LARGE_INTEGER expire_time) {
628626
return (int)res;
629627
}
630628

631-
static kern_return_t mk_timer_cancel(HANDLE name, LARGE_INTEGER *result_time) {
629+
static kern_return_t mk_timer_cancel(HANDLE name, AbsoluteTime *result_time) {
632630
BOOL res = CancelWaitableTimer(name);
633631
if (!res) {
634632
DWORD err = GetLastError();

0 commit comments

Comments
 (0)