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 - [PATCH] SDL_SemWaitTimeout busy waits
Summary: [PATCH] SDL_SemWaitTimeout busy waits
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 04:24 UTC by Colin Leroy
Modified: 2011-01-27 08:06 UTC (History)
0 users

See Also:


Attachments
Patch for LibSDL 1.2 (2.29 KB, patch)
2011-01-26 04:24 UTC, Colin Leroy
Details | Diff
Patch for LibSDL 1.3 (2.56 KB, patch)
2011-01-26 04:26 UTC, Colin Leroy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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! :)