Commit Graph

138 Commits

Author SHA1 Message Date
David Ludwig
49820874a9 WinRT: merged with latest, official, SDL 2.x sources (at rev. bea100d73d13) 2013-04-14 11:42:55 -04: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
David Ludwig
db53df0697 WinRT: merged with latest, official, SDL 2.x code 2013-02-23 20:01:46 -05:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
David Ludwig
e597faf23f WinRT: added a functional threading backend using C++11 apis 2012-11-24 11:17:23 -05:00
David Ludwig
0ff36e7874 WinRT: made the skeleton C++11 thread implementation use .cpp files, not .c 2012-11-22 23:12:06 -05:00
David Ludwig
a10ba5bcb9 WinRT: added a skeleton SDL backend for C++11-based threads 2012-11-22 23:03:56 -05: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
Sam Lantinga
37df96b8c7 Fixed bug 1128
Patrick Baggett      2011-02-16 22:58:33 PST

This enhancement is for both x86/x64 Windows.

The SDL implementation of mutexes uses the Win32 API interprocess
synchronization primitive called a "Mutex". This implementation is subpar
because it has a much higher overhead than an intraprocess mutex. The exact
technical details are below, but my tests have shown that for reasonably high
contention (10 threads on 4 physical cores), it has 13x higher overhead than
the Win32 CriticalSection API.

If this enhancement is accepted, I will write a patch to implement SDL mutexes
using the critical section API, which should dramatically reduce overhead and
improve scalability.


-- Tech details --
Normally, Win32 Mutexes are used across process boundaries to synchronize
separate processes. In order to lock or unlock them, a user->kernel space
transition is necessary, even in the uncontented case on a single CPU machine.
Win32 CriticalSection objects can only be used within the same process virtual
address space and thus to lock one, does not require a user->kernel space
transition for the uncontended case, and additionally may spin a short while
before going into kernel wait. This small spin allows a thread to obtain the
lock if the mutex is released shortly after the thread starts spinning, in
effect bypassing the overhead of user->kernel space transition which has higher
overhead than the spinning itself.
2011-02-17 09:13:12 -08:00
Sam Lantinga
572c033148 Patch to fix includes from Frank Zago 2011-02-15 16:41:04 -08:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00