Skip to content

Commit

Permalink
Merge pull request #201 from triplef/bugfix/NSConditionLock-tryLock
Browse files Browse the repository at this point in the history
Implemented -[NSConditionLock tryLock]
  • Loading branch information
Raj Seshasankaran committed Nov 9, 2015
2 parents 15e0436 + 135644d commit 3f281f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Frameworks/Foundation/NSCondition.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ - (void)wait {
pthread_cond_wait(&_cond, &_mutex);
}

- (BOOL)tryLock {
return pthread_mutex_trylock(&_mutex) == 0;
}

- (void)lockWhenCondition:(NSInteger)condition {
int rc;

Expand Down

0 comments on commit 3f281f6

Please sign in to comment.