Skip to content

Commit

Permalink
Merge branch 'jens/command-execution-timeout-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
jensutbult committed Nov 20, 2024
2 parents 72728a9 + ec4ed90 commit 5516907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ - (void)execute:(nonnull YKFAPDU *)command timeout:(NSTimeInterval)timeout compl
}];

// Lock the async call to enforce the sequential execution using the library dispatch queue.
dispatch_semaphore_wait(executionSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC)));
if(dispatch_semaphore_wait(executionSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC))) != 0) {
executionError = [YKFSessionError errorWithCode:YKFSessionErrorReadTimeoutCode];
}

// Do not notify if the operation was canceled.
if (operation.isCancelled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ - (void)execute:(nonnull YKFAPDU *)command timeout:(NSTimeInterval)timeout compl
}];

// Lock the async call to enforce the sequential execution using the library dispatch queue.
dispatch_semaphore_wait(executionSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC)));
if(dispatch_semaphore_wait(executionSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC))) != 0) {
executionError = [YKFSessionError errorWithCode:YKFSessionErrorReadTimeoutCode];
}

// Do not notify if the operation was canceled.
if (operation.isCancelled) {
Expand Down

0 comments on commit 5516907

Please sign in to comment.