summaryrefslogtreecommitdiff
path: root/test/testatomic.c
Commit message (Collapse)AuthorAgeFilesLines
* Updated copyright for 2021Sam Lantinga2021-01-021-1/+1
|
* Atomic test: Fix use after freeJoel Linn2020-12-231-8/+2
| | | | | | 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.
* testatomic.c: fix warnings due to SDL_AtomicDecRef() useOzkan Sezer2020-12-241-3/+3
|
* Updated copyright date for 2020Sam Lantinga2020-01-161-1/+1
|
* use SDL_zeroa at more places where the argument is an array.Ozkan Sezer2019-07-311-2/+2
|
* Updated copyright for 2019Sam Lantinga2019-01-041-1/+1
|
* Updated copyright for 2018Sam Lantinga2018-01-031-1/+1
|
* Fixed a bunch of compiler warnings.Ryan C. Gordon2017-08-291-1/+1
|
* Fixed bug 3744 - missing SDLCALL in several functionsSam Lantinga2017-08-131-4/+4
| | | | | | | Ozkan Sezer The attached patch adds missing SDLCALL to several functions, so that they properly match the headers as intended.
* Updated copyright for 2017Sam Lantinga2017-01-011-1/+1
|
* Fixed bug 3508 - variably modified ‘SDL_dummy_size’ at file scope in ↵Sam Lantinga2016-12-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove almost all instances of "volatile" keyword.Ryan C. Gordon2016-01-031-6/+6
| | | | | | | | | | | 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.
* Updated copyright to 2016Sam Lantinga2016-01-021-1/+1
|
* Replaced tabs with spaces in test programs.Philipp Wiesemann2015-11-251-7/+7
|
* Updated the copyright year to 2015Sam Lantinga2015-05-261-1/+1
|
* Removed redundant include statements from test programs.Philipp Wiesemann2015-02-181-3/+0
| | | | | 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.
* Fixed compiler warningSam Lantinga2014-07-071-1/+1
|
* Fixed initializing test event queueSam Lantinga2014-06-071-0/+1
|
* Fixed bug 2374 - Update copyright for 2014...Sam Lantinga2014-02-021-1/+1
| | | | Is it that time already??
* Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS ↵Andreas Schiffler2013-08-141-50/+59
| | | | solution: copy missing dependency
* Corrected words in comments of test programs.Philipp Wiesemann2013-07-271-1/+1
|
* Updated the copyright year for the test programsSam Lantinga2013-07-251-1/+1
|
* Removed unused variable and not needed assignment in test program.Philipp Wiesemann2013-07-131-1/+0
| | | | Found by Cppcheck.
* File style cleanup for the SDL 2.0 releaseSam Lantinga2013-05-181-40/+40
|
* Changed the name of SDL_mutexP() SDL_mutexV()Sam Lantinga2013-03-071-4/+4
|
* 1.3 API CHANGE: Add support for naming threads.Ryan C. Gordon2011-10-021-4/+8
|
* SDL 1.3 is now under the zlib license.Sam Lantinga2011-04-081-0/+11
|
* Bump up the default cache line size.Sam Lantinga2011-01-271-0/+1
|
* Added cache line size info in SDL_cpuinfo.hSam Lantinga2011-01-271-10/+7
| | | | 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.
* Fixed compiling under Visual StudioSam Lantinga2011-01-271-1/+0
|
* Since we're directly reading and writing 'active' from different threads, it ↵Sam Lantinga2011-01-261-1/+1
| | | | needs to be flagged volatile.
* Added a test to measure the impact of a separate thread periodically locking ↵Sam Lantinga2011-01-261-26/+99
| | | | the queue entirely.
* Added a FIFO test to the atomic test suite.Sam Lantinga2011-01-251-0/+393
| | | | | This is really useful because we might be able to use something like this for the SDL event queue.
* Michael gave permission to use his test codeSam Lantinga2011-01-181-3/+10
|
* Fixed compiler errorsSam Lantinga2011-01-171-10/+9
|
* Include windows.h in SDL_atomic.h by default, but don't include the atomic ↵Sam Lantinga2011-01-161-0/+2
| | | | | | 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
* Added native atomic operations for Windows, Mac OS X, and gcc compiler ↵Sam Lantinga2011-01-161-4/+168
| | | | | | | intrinsics. Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier() Added an atomic test adapted from code by Michael Davidsaver
* Updated the atomic API for better use casesSam Lantinga2011-01-151-111/+50
|
* Fixed bug #817Sam Lantinga2009-10-041-2/+3
| | | | | | | | | | 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
* Better cross-platform macros for printing 32 and 64 bit valuesSam Lantinga2009-09-291-22/+34
|
* Ok, added long casts to get rid of compiler warnings.Bob Pendleton2009-09-281-11/+11
|
* int testmmousetable.c the arguments to main() are not compatible with what ↵Bob Pendleton2009-09-231-1/+1
| | | | | | is required in SDL_main.h Cleaned up testatomic.c to use the same syntax as every other test program.
* The new, cleaner, version of the atomic operations. The dummy code is what ↵Bob Pendleton2009-09-171-24/+9
| | | | | | | | | | 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!)
* Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.Bob Pendleton2009-08-111-102/+0
|
* volitile... duh, yeah the variable need to be labeled volitileBob Pendleton2009-07-091-4/+4
|
* I've made so many changes I don't dare continue until I check the current ↵Bob Pendleton2009-06-291-9/+191
| | | | | | | | | | | | | | | | | | | | 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. :-)
* Disabling 64 bit atomics operations until I figure out why they do not link.Bob Pendleton2009-06-241-58/+45
|
* This check in updates SDL_atomic.h to reflect the new set of atomic ↵Bob Pendleton2009-06-241-47/+47
| | | | | | | | 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.
* indentSam Lantinga2009-06-101-53/+53
|
* First commit for SDL atomic operations.Bob Pendleton2009-06-091-0/+64
On my linux box it compiles and installs correctly and testatomic runs without errors.