| Summary: | new SDL_MutexTryLock API | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Edward Rudd <urkle> |
| Component: | thread | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
Implementation of MutexTryLock for all supported platforms.
quick fix for pthread TryLock implementation Reworked patch with different naming. |
||
Created attachment 975 [details]
quick fix for pthread TryLock implementation
Ok I forgot to add a #include <errno.h>.. So it's added and this now works on OSX/Linux
Created attachment 1007 [details]
Reworked patch with different naming.
This patch renamed the method to SDL_TryLockMutex to be consistent with the current mutex method names. and combines the two patches into one.
Sam, any objections to this patch? I think it's worth including. --ryan. |
Created attachment 972 [details] Implementation of MutexTryLock for all supported platforms. This new API method allows a TryLock concept to be applied to a Mutex.. This will attempt to lock the mutex, and if someone else has it locked will return SDL_MUTEX_TIMEDOUT to let the caller know that it's locked elsewhere. I have included implementations for generic, nds, windows, and pthread. (seems to be all of the implementations I needed to implement)