Closed Bug 1129244 Opened 5 years ago Closed 5 years ago

[Nuwa] wrap pthread_mutex_trylock

Categories

(Core :: mozglue, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

pthread_mutex_lock is wrapped, I see no reason pthread_mutex_trylock shouldn't be too. In fact, it seems dangerous that it isn't.
Attached patch patchSplinter Review
Attachment #8558860 - Flags: review?(tlee)
No longer blocks: 1121269
Comment on attachment 8558860 [details] [diff] [review]
patch

Review of attachment 8558860 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!

By definition, http://linux.die.net/man/3/pthread_mutex_lock , pthread_mutex_trylock() has the same behavior as pthread_mutex_lock(), except pthread_mutex_trylock() could be EBUSY, but pthread_mutex_lock() does not, and pthread_mutex_lock() could be EDEADLK, but pthread_mutex_trylock() does not.  They are so similar, so to wrap pthread_mutex_trylock() with the same pattern of code seems very promise.
Attachment #8558860 - Flags: review?(tlee) → review+
https://hg.mozilla.org/mozilla-central/rev/f478222a6166
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.