fix: Don't timeout XPC connections in the debugger.

This commit is contained in:
clobber
2021-01-05 11:51:34 -07:00
parent 733d590418
commit 8853ccbfe0
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -92,7 +92,10 @@ int xpc_task_key = 0;
endpoint = ep;
dispatch_semaphore_signal(sem);
}];
#ifdef DEBUG_PRINT
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
#else
dispatch_time_t waitTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC * 2));
if (dispatch_semaphore_wait(sem, waitTime) != 0)
{
@@ -106,6 +109,7 @@ int xpc_task_key = 0;
}];
}
}
#endif
[cn setInvalidationHandler:nil];
[cn invalidate];
+5 -1
View File
@@ -69,7 +69,10 @@ extern NSString *kHelperIdentifierArgumentPrefix;
os_log_info(OE_LOG_HELPER, "Successfully connected helper to host. { id = '%{public}@' }", identifier);
dispatch_semaphore_signal(sem);
}];
#ifdef DEBUG_PRINT
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
#else
dispatch_time_t waitTime = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2);
if (dispatch_semaphore_wait(sem, waitTime) != 0)
{
@@ -78,6 +81,7 @@ extern NSString *kHelperIdentifierArgumentPrefix;
[listener invalidate];
listener = nil;
}
#endif
[cn setInvalidationHandler:nil];
[cn invalidate];