| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
SDL_SemPost() was called by the FIFO threads after the semaphore was
freed because the main thread actually synchronized on the
`writerRunning`/`readersRunning` count and not the semaphores itself.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Ozkan Sezer
The attached patch adds missing SDLCALL to several functions, so that
they properly match the headers as intended.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test/testatomic.c
Ciro Santilli
GCC 6, Ubuntu 16.10, cd test; ./configure; make
/bin/sh config.status Makefile
config.status: creating Makefile
gcc -o loopwave loopwave.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
gcc -o testatomic testatomic.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
In file included from /usr/include/SDL2/SDL_main.h:25:0,
from /usr/include/SDL2/SDL.h:32,
from testatomic.c:14:
/usr/include/SDL2/SDL_stdinc.h:261:20: error: variably modified ‘SDL_dummy_size’ at file scope
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
^
testatomic.c:106:1: note: in expansion of macro ‘SDL_COMPILE_TIME_ASSERT’
SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
^~~~~~~~~~~~~~~~~~~~~~~
Makefile:114: recipe for target 'testatomic' failed
make: *** [testatomic] Error 1
If I remove the line SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */ it works, lazy to figure out the best way to do this.
|
|
|
|
|
|
|
|
|
|
|
| |
As Tiffany pointed out in Bugzilla, volatile is not useful for thread safety:
https://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/
Some of these volatiles didn't need to be, some were otherwise protected by
spinlocks or mutexes, and some got moved over to SDL_atomic_t data, etc.
Fixes Bugzilla #3220.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The needed header files are already included with SDL.h. Still including them in
the test programs is confusing because it somehow suggests they would be needed.
|
| |
|
| |
|
|
|
|
| |
Is it that time already??
|
|
|
|
| |
solution: copy missing dependency
|
| |
|
| |
|
|
|
|
| |
Found by Cppcheck.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
I also added an implementation to dynamically query it, but didn't expose it since most x86 CPUs have an L1 cache line size of 64 bytes.
|
| |
|
|
|
|
| |
needs to be flagged volatile.
|
|
|
|
| |
the queue entirely.
|
|
|
|
|
| |
This is really useful because we might be able to use something like this
for the SDL event queue.
|
| |
|
| |
|
|
|
|
|
|
| |
API in SDL.h
This allows all SDL code to take advantage of the atomic intrinsics on Windows, but doesn't cause applications just including SDL.h to pull in windows.h
|
|
|
|
|
|
|
| |
intrinsics.
Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier()
Added an atomic test adapted from code by Michael Davidsaver
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Daniele Forghieri 2009-09-30 15:48:24 PDT
Some tests doesn't use the correct include statement (and there are some
missing declaration) and some test use C++ variable after statement, preventing
compile wicth Open Watcom
The patch attached fixes this
|
| |
|
| |
|
|
|
|
|
|
| |
is required in SDL_main.h
Cleaned up testatomic.c to use the same syntax as every other test program.
|
|
|
|
|
|
|
|
|
|
| |
you should start working with to port atomic ops.
The linux code appears to be complete and *should* be the base of all Unix and GCC based versions. The macosx and win32 versions
are currently just copies of the dummy code. I will begin working on the windows version as soon as this check in is done. I
need someone to work on the Mac OS X version.
I'm afraid that this check in will break QNX (Sorry!)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
stuff in.
/test/testatomic.c performs absolutely basic tests to show that the function work as expected. Need a second test to do more detailed tests.
/include/SDL_atomic.h provides declarations for all included functions.
/src/atomic/linux/SDL_atomic.c provided all the functions. On a generic built the 64 bit functions work, but they are emulated. On a build for -march=pentium and above the 64 bit functions use native instructions
/src/atomic/dummy/SDL_atomic.c emulates all the operations using SDL_mutex.h.
/src/atomic/win32/SDL_atomic.c is a copy of dummy
/src/atomic/macosx/SDL_atomic.s is a copy of dummy
These versions of SDL_atomic.c provide a frame work for building the library with a mixture of native and emulated functions. This allows the whole library to be provided on all platforms. (I hope.)
I hope this fits with the SDL philosophy of either providing a common subset or emulating when the platform is missing a feature.
I have not added dummy, macosx, or win32 to the build. They are there as place holders for future work.
I have modified congifure.in to compile sources in /src/atomic/linux. (The SDL configure.in file is an amazing piece of work and I hope I didn't mess it up. :-)
|
| |
|
|
|
|
|
|
|
|
| |
operations in 32 and 64 bit form.
It also update configure.in to compile the linux version of the library. The three versions are all dummies
implementations that do nothing. They are being checked in as place holders. Mostly, I just wanted to get
place holders and the configure.in checked in.
|
| |
|
|
On my linux box it compiles and installs correctly and testatomic runs without errors.
|