Skip to content

Commit

Permalink
change timeout of asynchronous callback to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
FischLu authored and FischLu committed Nov 2, 2024
1 parent 316c5b0 commit 2b83e1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/osutils/macutils/AppKitImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ - (bool)enableScreenRecording
}];

// Wait for the asynchronous callback to complete
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC);
dispatch_semaphore_wait(sema, timeout);

// Return the final result
return hasPermission;
Expand Down

0 comments on commit 2b83e1b

Please sign in to comment.