Commit Graph

141 Commits

Author SHA1 Message Date
Ryan C. Gordon
ee3cbb1fa6 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Sam Lantinga
f5306d72d0 Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
2013-07-10 18:31:17 -07:00
Sam Lantinga
5a15888731 Fixed Haiku build 2013-07-10 02:37:57 -07:00
Sam Lantinga
9c0dea8e15 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Sam Lantinga
266b3c869f Fixed bug 1936 - Broken URL in generic SDL_syscond.c
cp.ml.x.dev

A comment in 'src/thread/generic/SDL_syscond.c' references the URL 'http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html', which cannot be resolved anymore. An alternative would be 'http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop'.
2013-07-06 00:28:54 -07:00
Sam Lantinga
d8b6e04ab1 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Sam Lantinga
35b9ffa392 Fixed bug 1881 - SDL will not compile with "SDL_THREADS" disabled.
MakoEnergy02

I am attempting to compile SDL on WindowsXP 32-bit, using MinGW.  The problem I am having is when I attempt to compile, when it gets to "SDL_systhread.c" it errors:

C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\SDL_systhread.c|29|error: conflicting types for 'SDL_SYS_CreateThread'
C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\..\SDL_systhread.h|35|note: previous declaration of 'SDL_SYS_CreateThread' was here

I do have SDL_THREADS disabled in my cmake configuration as I do not want or need SDL making threads for me, I have another thread provider.  It seems the generic "dummy" implementation does not account for the two extra parameters needed for the "SDL_SYS_CreateThread" method when "SDL_PASSED_BEGINTHREAD_ENDTHREAD" is defined.
2013-06-02 01:12:29 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
f0af9a3e70 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00
Captain Lex
a18bccd5f3 Add PSP support 2013-03-17 20:07:02 +08:00
Andreas Schiffler
1673a640c3 Fix SDL_TryLockMutex compile error when FAKE_RECURSIVE_MUTEX is defined 2013-03-09 09:24:43 -08:00
Sam Lantinga
2952d9bf48 Changed the name of SDL_mutexP() SDL_mutexV() 2013-03-07 20:12:40 -08:00
Edward Rudd
7c3cb6e7f4 move variable declaration to beginning of function 2013-03-06 10:37:27 -05:00
Edward Rudd
e4d41effe3 Add SDL_TryLockMutex and implementations for all platforms 2013-03-05 18:54:55 -05:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Ryan C. Gordon
c6b8824839 Whoops, let's not redefine the actual symbol. 2012-11-03 12:11:49 -04:00
Ryan C. Gordon
6969b0e744 Make Linux dynamically look up pthread_setname_np() for older glibc compat.
Cleaned up the lookup code to make Mac OS X use most of the same code.
2012-11-03 12:06:27 -04:00
Sam Lantinga
b89298c92c Really fixed the Mac build this time. 2012-10-23 23:44:56 -07:00
Sam Lantinga
6d3b1f137c Fixed Mac OS X build 2012-10-23 17:46:57 -07:00
Sam Lantinga
08f46b5fa5 Fixed running SDL on older versions of Mac OS X. pthread_setname_np() was introduced in 10.6. 2012-10-23 16:06:06 -07:00
Sam Lantinga
b3d60cfcbb Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Ryan C. Gordon
b3b40aac16 Removed Windows CE support from SDL 2.0.
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
2012-09-15 10:59:39 -04:00
Gabriel Jacobo
af5f6d6ddb Fixes #1422, removes global JNI Env, uses per thread copies, adds thread auto detaching. 2012-07-09 18:08:06 -03:00
Sam Lantinga
6ff55c1ca2 Fixed bug 1426 - SDL_SemWaitTimeout returns -1 and sets error instead of SDL_MUTEX_TIMEDOUT on time out
deraj 2012-02-19 19:01:08 PST

Fix to treat ETIMEDOUT as a time out instead of an error (and update the test)
2012-02-20 23:51:53 -05:00
Sam Lantinga
243a72784f Check for sem_timedwait(), which isn't available on some systems (including OpenBSD 2012-01-15 03:34:14 -05:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6371c44a9e Lots of fixes importing SDL source wholesale into a new iOS project 2011-10-31 05:56:58 -04:00
Ryan C. Gordon
2014d62292 Don't crash with a NULL thread name. 2011-10-18 00:34:45 -04:00
Ryan C. Gordon
bebad17430 Fixed a whole slew of compiler warnings that -Wall exposed. 2011-10-13 01:08:30 -04:00
Ryan C. Gordon
41f4356ae7 Disable thread naming on Windows for now.
We need the C runtime, which we don't link against, for __try/__except.
2011-10-02 00:59:11 -04:00
Ryan C. Gordon
79077a2d15 Patched to compile on Mac OS X (I think). 2011-10-02 00:49:52 -04:00
Ryan C. Gordon
ce0c9e37fd Further patched to compile on Windows. 2011-10-02 00:43:56 -04:00
Ryan C. Gordon
652f5a7622 Patched to compile on Windows. 2011-10-02 00:36:18 -04:00
Ryan C. Gordon
2ef51927fe 1.3 API CHANGE: Add support for naming threads. 2011-10-02 00:29:16 -04:00
Ryan C. Gordon
7c206c10b5 Don't call pthread_exit(), returning from RunThread() is equivalent. 2011-09-20 17:48:29 -04:00
Ryan C. Gordon
a2878205f5 Simplified Windows RunThread().
Removed checks for things that are always true, free unneeded struct before
 calling thread entry point, instead of after thread completes.
2011-09-20 17:42:58 -04:00
Ryan C. Gordon
fe04e23133 Merged Nathan Heisey's Haiku work into the main SDL 1.3 branch.
This was a Google Summer of Code 2011 project, sponsored by the Haiku project.

We thank Nathan and the other Haiku developers for their support!
2011-09-15 23:51:07 -04:00
Ryan C. Gordon
b84e7104b1 Clean up the win32 compiler warnings for SDL threads, in the 1.3 branch. 2011-09-12 13:36:38 -04:00
Ryan C. Gordon
079d39970c More work on cleaning out compiler warnings. 2011-09-11 04:02:40 -04:00
Nathan Heisey
b71435641b Should compile now (fixed typos(?)) 2011-07-14 17:58:47 +00:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
2b487fd839 Android defines linux, but doesn't have the gettid system call. 2011-03-25 13:48:48 -07:00
Sam Lantinga
3b7e2a872d Warn people not to run their applications as root! 2011-03-25 12:54:21 -07:00
Sam Lantinga
73247db7d8 The API sets the priority for the current thread, not an arbitrary thread.
Implemented thread priority as the 'nice' value on Linux.  High priority threads require root permissions (you shouldn't give your game root permissions though!)
2011-03-25 12:44:06 -07:00
Sam Lantinga
eeb5f362e4 Implemented SDL_SetThreadPriority() 2011-03-25 10:47:49 -07:00
Sam Lantinga
b710eb9280 Fixed so code will compile with SDL_config_minimal.h 2011-03-12 13:21:57 -08:00
Sam Lantinga
ac080d02da Fixed permissions for C source files 2011-03-11 11:52:41 -08:00
Sam Lantinga
3d078dceac Fixed compiler warning 2011-03-06 21:15:46 -08:00
Sam Lantinga
acbbcf8bfd Our minimum Windows version is Windows 2000, so it's okay to directly call InitializeCriticalSectionAndSpinCount().. 2011-02-17 09:26:15 -08:00