We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1108

Summary: [PATCH] SDL_SemWaitTimeout busy waits
Product: SDL Reporter: Colin Leroy <colin>
Component: threadAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Patch for LibSDL 1.2
Patch for LibSDL 1.3

Description Colin Leroy 2011-01-26 04:24:20 UTC
Created attachment 559 [details]
Patch for LibSDL 1.2

Hi,

the pthread implementation of SDL_SemWaitTimeout() uses busy waiting, while pthread's sem_timedwait() does work. Attached are patches that make use of it, one for LibSDL 1.2, one for 1.3.

Hope this helps.
Comment 1 Colin Leroy 2011-01-26 04:26:17 UTC
Created attachment 560 [details]
Patch for LibSDL 1.3
Comment 2 Sam Lantinga 2011-01-26 19:18:36 UTC
Thank you very much for your patch for SDL 1.3!

Do you give me permission to release your code with SDL 1.3 and future
versions of SDL under both the LGPL and a closed-source commercial
license?
Comment 3 Colin Leroy 2011-01-27 00:07:50 UTC
Yes, feel free to release it under both the LGPL and a closed-source commercial
license, no problem with that :-)
Comment 4 Sam Lantinga 2011-01-27 00:35:06 UTC
Thanks!  I've added your change to the repository.
http://hg.libsdl.org/SDL/rev/d547877e355e
Comment 5 Colin Leroy 2011-01-27 00:58:18 UTC
Thank you!

Will you commit it to SDL 1.2 too ?
I seem to understand that you don't plan on releasing another SDL 1.2, but I've seen patches to this branch, so... I'd love to see an 1.2.15 :)
Comment 6 Sam Lantinga 2011-01-27 08:06:50 UTC
Yes, I applied both patches.  Thanks! :)