Rename SDL_atomic_t to SDL_AtomicInt

main
David Demelier 2023-02-23 20:33:51 +01:00 committed by Sam Lantinga
parent 8994878767
commit d0c4849d0b
33 changed files with 81 additions and 70 deletions

View File

@ -2529,3 +2529,7 @@ constant c1, c2;
@@
- SDL_CreateShapedWindow(e1, c1, c2, e2, e3, e4)
+ SDL_CreateShapedWindow(e1, e2, e3, e4)
typedef SDL_atomic_t, SDL_AtomicInt;
@@
- SDL_atomic_t
+ SDL_AtomicInt

View File

@ -46,6 +46,11 @@ begin_code.h and close_code.h in the public headers have been renamed to SDL_beg
The vi format comments have been removed from source code. Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim) to automatically set tab spacing for the SDL coding style.
## SDL_atomic.h
The following structures have been renamed:
- SDL_atomic_t => SDL_AtomicInt
## SDL_audio.h
SDL_AudioInit() and SDL_AudioQuit() have been removed. Instead you can call SDL_InitSubSytem() and SDL_QuitSubSytem() with SDL_INIT_AUDIO, which will properly refcount the subsystems. You can choose a specific audio driver using SDL_AUDIO_DRIVER hint.
@ -1115,4 +1120,3 @@ SDL_Vulkan_GetInstanceExtensions() no longer takes a window parameter.
SDL_Vulkan_GetVkGetInstanceProcAddr() now returns `SDL_FunctionPointer` instead of `void *`, and should be cast to PFN_vkGetInstanceProcAddr.
SDL_Vulkan_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place.

View File

@ -266,7 +266,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
* \brief A type representing an atomic integer value. It is a struct
* so people don't accidentally use numeric operations on it.
*/
typedef struct { int value; } SDL_atomic_t;
typedef struct { int value; } SDL_AtomicInt;
/**
* Set an atomic variable to a new value if it is currently an old value.
@ -274,7 +274,7 @@ typedef struct { int value; } SDL_atomic_t;
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param a a pointer to an SDL_AtomicInt variable to be modified
* \param oldval the old value
* \param newval the new value
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
@ -285,7 +285,7 @@ typedef struct { int value; } SDL_atomic_t;
* \sa SDL_AtomicGet
* \sa SDL_AtomicSet
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval);
/**
* Set an atomic variable to a value.
@ -295,7 +295,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param a a pointer to an SDL_AtomicInt variable to be modified
* \param v the desired value
* \returns the previous value of the atomic variable.
*
@ -303,7 +303,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
*
* \sa SDL_AtomicGet
*/
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
/**
* Get the value of an atomic variable.
@ -311,14 +311,14 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable
* \param a a pointer to an SDL_AtomicInt variable
* \returns the current value of an atomic variable.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_AtomicSet
*/
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
/**
* Add to an atomic variable.
@ -328,7 +328,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param a a pointer to an SDL_AtomicInt variable to be modified
* \param v the desired value to add
* \returns the previous value of the atomic variable.
*
@ -337,7 +337,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
* \sa SDL_AtomicDecRef
* \sa SDL_AtomicIncRef
*/
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
/**
* \brief Increment an atomic variable used as a reference count.

View File

@ -39,6 +39,9 @@
*/
#ifdef SDL_ENABLE_OLD_NAMES
/* ##SDL_atomic.h */
#define SDL_atomic_t SDL_AtomicInt
/* ##SDL_audio.h */
#define SDL_AudioStreamAvailable SDL_GetAudioStreamAvailable
#define SDL_AudioStreamClear SDL_ClearAudioStream

View File

@ -123,7 +123,7 @@ static SDL_INLINE void leaveLock(void *a)
#endif
SDL_bool
SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval)
{
#ifdef HAVE_MSC_ATOMICS
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
@ -183,7 +183,7 @@ SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
#endif
}
int SDL_AtomicSet(SDL_atomic_t *a, int v)
int SDL_AtomicSet(SDL_AtomicInt *a, int v)
{
#ifdef HAVE_MSC_ATOMICS
SDL_COMPILE_TIME_ASSERT(atomic_set, sizeof(long) == sizeof(a->value));
@ -223,7 +223,7 @@ SDL_AtomicSetPtr(void **a, void *v)
#endif
}
int SDL_AtomicAdd(SDL_atomic_t *a, int v)
int SDL_AtomicAdd(SDL_AtomicInt *a, int v)
{
#ifdef HAVE_MSC_ATOMICS
SDL_COMPILE_TIME_ASSERT(atomic_add, sizeof(long) == sizeof(a->value));
@ -246,7 +246,7 @@ int SDL_AtomicAdd(SDL_atomic_t *a, int v)
#endif
}
int SDL_AtomicGet(SDL_atomic_t *a)
int SDL_AtomicGet(SDL_AtomicInt *a)
{
#ifdef HAVE_ATOMIC_LOAD_N
return __atomic_load_n(&a->value, __ATOMIC_SEQ_CST);

View File

@ -138,9 +138,9 @@ struct SDL_AudioDevice
SDL_AudioStream *stream;
/* Current state flags */
SDL_atomic_t shutdown; /* true if we are signaling the play thread to end. */
SDL_atomic_t enabled; /* true if device is functioning and connected. */
SDL_atomic_t paused;
SDL_AtomicInt shutdown; /* true if we are signaling the play thread to end. */
SDL_AtomicInt enabled; /* true if device is functioning and connected. */
SDL_AtomicInt paused;
SDL_bool iscapture;
/* Scratch buffer used in the bridge between SDL and the user callback. */

View File

@ -894,7 +894,7 @@ static void ALSA_HotplugIteration(void)
}
#if SDL_ALSA_HOTPLUG_THREAD
static SDL_atomic_t ALSA_hotplug_shutdown;
static SDL_AtomicInt ALSA_hotplug_shutdown;
static SDL_Thread *ALSA_hotplug_thread;
static int SDLCALL ALSA_HotplugThread(void *arg)

View File

@ -64,7 +64,7 @@ struct SDL_PrivateAudioData
char *thread_error;
#if MACOSX_COREAUDIO
AudioDeviceID deviceID;
SDL_atomic_t device_change_flag;
SDL_AtomicInt device_change_flag;
#else
SDL_bool interrupted;
CFTypeRef interruption_listener;

View File

@ -38,7 +38,7 @@ extern "C" {
struct SDL_PrivateAudioData
{
SDL_atomic_t refcount;
SDL_AtomicInt refcount;
WCHAR *devid;
WAVEFORMATEX *waveformat;
IAudioClient *client;
@ -52,7 +52,7 @@ struct SDL_PrivateAudioData
int default_device_generation;
SDL_bool device_lost;
void *activation_handler;
SDL_atomic_t just_activated;
SDL_AtomicInt just_activated;
};
/* win32 and winrt implementations call into these. */

View File

@ -56,8 +56,8 @@ static Platform::String ^ SDL_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4
static void WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid);
static void WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid);
extern "C" {
SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration;
SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration;
SDL_AtomicInt SDL_IMMDevice_DefaultPlaybackGeneration;
SDL_AtomicInt SDL_IMMDevice_DefaultCaptureGeneration;
}
/* This is a list of device id strings we have inflight, so we have consistent pointers to the same device. */

View File

@ -366,7 +366,7 @@ static SDL_bool bHasNewData;
static SDL_bool bHasEnvironmentVariables;
static SDL_atomic_t bPermissionRequestPending;
static SDL_AtomicInt bPermissionRequestPending;
static SDL_bool bPermissionRequestResult;
/* Android AssetManager */
@ -1359,7 +1359,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetenv)(
Functions called by SDL into Java
*******************************************************************************/
static SDL_atomic_t s_active;
static SDL_AtomicInt s_active;
struct LocalReferenceHolder
{
JNIEnv *m_env;

View File

@ -52,8 +52,8 @@ static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x
/* *INDENT-ON* */ /* clang-format on */
/* these increment as default devices change. Opened default devices pick up changes in their threads. */
SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration;
SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration;
SDL_AtomicInt SDL_IMMDevice_DefaultPlaybackGeneration;
SDL_AtomicInt SDL_IMMDevice_DefaultCaptureGeneration;
static void GetMMDeviceInfo(IMMDevice *device, char **utf8dev, WAVEFORMATEXTENSIBLE *fmt, GUID *guid)
{
@ -180,7 +180,7 @@ static void SDL_IMMDevice_Add(const SDL_bool iscapture, const char *devname, WAV
typedef struct SDLMMNotificationClient
{
const IMMNotificationClientVtbl *lpVtbl;
SDL_atomic_t refcount;
SDL_AtomicInt refcount;
SDL_bool useguid;
} SDLMMNotificationClient;

View File

@ -35,7 +35,7 @@ int SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int isca
SDL_AudioFormat WaveFormatToSDLFormat(WAVEFORMATEX *waveformat);
/* these increment as default devices change. Opened default devices pick up changes in their threads. */
extern SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration;
extern SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration;
extern SDL_AtomicInt SDL_IMMDevice_DefaultPlaybackGeneration;
extern SDL_AtomicInt SDL_IMMDevice_DefaultCaptureGeneration;
#endif /* SDL_IMMDEVICE_H */

View File

@ -122,13 +122,13 @@ SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromRW,(SDL_RWops *a, int b),(a,b),ret
SDL_DYNAPI_PROC(int,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_RWops*,SDL_CreateRW,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_atomic_t *a, int b),(a,b),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCAS,(SDL_atomic_t *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_AtomicInt *a, int b),(a,b),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCAS,(SDL_AtomicInt *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCASPtr,(void **a, void *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_AtomicGet,(SDL_atomic_t *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_AtomicGet,(SDL_AtomicInt *a),(a),return)
SDL_DYNAPI_PROC(void*,SDL_AtomicGetPtr,(void **a),(a),return)
SDL_DYNAPI_PROC(void,SDL_AtomicLock,(SDL_SpinLock *a),(a),)
SDL_DYNAPI_PROC(int,SDL_AtomicSet,(SDL_atomic_t *a, int b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_AtomicSet,(SDL_AtomicInt *a, int b),(a,b),return)
SDL_DYNAPI_PROC(void*,SDL_AtomicSetPtr,(void **a, void *b),(a,b),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicTryLock,(SDL_SpinLock *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_AtomicUnlock,(SDL_SpinLock *a),(a),)

View File

@ -60,7 +60,7 @@ static SDL_EventWatcher *SDL_event_watchers = NULL;
static int SDL_event_watchers_count = 0;
static SDL_bool SDL_event_watchers_dispatching = SDL_FALSE;
static SDL_bool SDL_event_watchers_removed = SDL_FALSE;
static SDL_atomic_t SDL_sentinel_pending;
static SDL_AtomicInt SDL_sentinel_pending;
typedef struct
{
@ -89,7 +89,7 @@ static struct
{
SDL_mutex *lock;
SDL_bool active;
SDL_atomic_t count;
SDL_AtomicInt count;
int max_events_seen;
SDL_EventEntry *head;
SDL_EventEntry *tail;

View File

@ -47,7 +47,7 @@ struct haptic_hwdata
SDL_Thread *thread;
SDL_mutex *mutex;
Uint64 stopTicks;
SDL_atomic_t stopThread;
SDL_AtomicInt stopThread;
};
/*

View File

@ -113,7 +113,7 @@ static int SDL_joysticks_locked;
static SDL_bool SDL_joysticks_initialized;
static SDL_bool SDL_joysticks_quitting = SDL_FALSE;
static SDL_Joystick *SDL_joysticks SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
static SDL_atomic_t SDL_last_joystick_instance_id SDL_GUARDED_BY(SDL_joystick_lock);
static SDL_AtomicInt SDL_last_joystick_instance_id SDL_GUARDED_BY(SDL_joystick_lock);
static int SDL_joystick_player_count SDL_GUARDED_BY(SDL_joystick_lock) = 0;
static SDL_JoystickID *SDL_joystick_players SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE;

View File

@ -41,8 +41,8 @@ typedef struct SDL_HIDAPI_RumbleRequest
typedef struct SDL_HIDAPI_RumbleContext
{
SDL_atomic_t initialized;
SDL_atomic_t running;
SDL_AtomicInt initialized;
SDL_AtomicInt running;
SDL_Thread *thread;
SDL_sem *request_sem;
SDL_HIDAPI_RumbleRequest *requests_head;

View File

@ -71,7 +71,7 @@ typedef struct SDL_HIDAPI_Device
void *context;
SDL_mutex *dev_lock;
SDL_hid_device *dev;
SDL_atomic_t rumble_pending;
SDL_AtomicInt rumble_pending;
int num_joysticks;
SDL_JoystickID *joysticks;

View File

@ -95,7 +95,7 @@ static void RAWINPUT_JoystickClose(SDL_Joystick *joystick);
typedef struct SDL_RAWINPUT_Device
{
SDL_atomic_t refcount;
SDL_AtomicInt refcount;
char *name;
char *path;
Uint16 vendor_id;

View File

@ -208,7 +208,7 @@ static SDL_bool SDL_IsXInputDevice(Uint16 vendor, Uint16 product)
typedef struct RawGameControllerDelegate
{
__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController iface;
SDL_atomic_t refcount;
SDL_AtomicInt refcount;
} RawGameControllerDelegate;
static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInterface(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This, REFIID riid, void **ppvObject)

View File

@ -50,7 +50,7 @@ static SDL_SensorDriver *SDL_sensor_drivers[] = {
};
static SDL_mutex *SDL_sensor_lock = NULL; /* This needs to support recursive locks */
static SDL_Sensor *SDL_sensors SDL_GUARDED_BY(SDL_sensor_lock) = NULL;
static SDL_atomic_t SDL_last_sensor_instance_id SDL_GUARDED_BY(SDL_sensor_lock);
static SDL_AtomicInt SDL_last_sensor_instance_id SDL_GUARDED_BY(SDL_sensor_lock);
void SDL_LockSensors(void) SDL_ACQUIRE(SDL_sensor_lock)
{

View File

@ -5203,7 +5203,7 @@ static struct
SDL_calloc_func calloc_func;
SDL_realloc_func realloc_func;
SDL_free_func free_func;
SDL_atomic_t num_allocations;
SDL_AtomicInt num_allocations;
} s_mem = {
real_malloc, real_calloc, real_realloc, real_free, { 0 }
};

View File

@ -29,7 +29,7 @@
SDL_TLSID
SDL_TLSCreate(void)
{
static SDL_atomic_t SDL_tls_id;
static SDL_AtomicInt SDL_tls_id;
return SDL_AtomicIncRef(&SDL_tls_id) + 1;
}

View File

@ -62,7 +62,7 @@ struct SDL_Thread
SDL_threadID threadid;
SYS_ThreadHandle handle;
int status;
SDL_atomic_t state; /* SDL_THREAD_STATE_* */
SDL_AtomicInt state; /* SDL_THREAD_STATE_* */
SDL_error errbuf;
char *name;
size_t stacksize; /* 0 for default, >0 for user-specified stack size. */

View File

@ -34,7 +34,7 @@ typedef struct SDL_Timer
void *param;
Uint64 interval;
Uint64 scheduled;
SDL_atomic_t canceled;
SDL_AtomicInt canceled;
struct SDL_Timer *next;
} SDL_Timer;
@ -50,7 +50,7 @@ typedef struct
{
/* Data used by the main thread */
SDL_Thread *thread;
SDL_atomic_t nextID;
SDL_AtomicInt nextID;
SDL_TimerMap *timermap;
SDL_mutex *timermap_lock;
@ -62,7 +62,7 @@ typedef struct
SDL_sem *sem;
SDL_Timer *pending;
SDL_Timer *freelist;
SDL_atomic_t active;
SDL_AtomicInt active;
/* List of timers - this is only touched by the timer thread */
SDL_Timer *timers;

View File

@ -310,7 +310,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, U
}
static SDL_VideoDevice *_this = NULL;
static SDL_atomic_t SDL_messagebox_count;
static SDL_AtomicInt SDL_messagebox_count;
static int SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window *window, const SDL_Rect *rects, int numrects)
{

View File

@ -41,7 +41,7 @@ struct SDL_GLDriverData
@interface SDLOpenGLContext : NSOpenGLContext
{
SDL_atomic_t dirty;
SDL_AtomicInt dirty;
SDL_Window *window;
CVDisplayLinkRef displayLink;
@public
@ -49,9 +49,9 @@ struct SDL_GLDriverData
@public
SDL_cond *swapIntervalCond;
@public
SDL_atomic_t swapIntervalSetting;
SDL_AtomicInt swapIntervalSetting;
@public
SDL_atomic_t swapIntervalsPassed;
SDL_AtomicInt swapIntervalsPassed;
}
- (id)initWithFormat:(NSOpenGLPixelFormat *)format

View File

@ -94,7 +94,7 @@ struct SDL_WindowData
/* floating dimensions for restoring from maximized and fullscreen */
int floating_width, floating_height;
SDL_atomic_t swap_interval_ready;
SDL_AtomicInt swap_interval_ready;
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
struct qt_extended_surface *extended_surface;

View File

@ -36,7 +36,7 @@ static void RunBasicTest(void)
int value;
SDL_SpinLock lock = 0;
SDL_atomic_t v;
SDL_AtomicInt v;
SDL_bool tfret = SDL_FALSE;
SDL_Log("\nspin lock---------------------------------------\n\n");
@ -106,9 +106,9 @@ enum
};
SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */
static SDL_atomic_t good = { 42 };
static SDL_AtomicInt good = { 42 };
static atomicValue bad = 42;
static SDL_atomic_t threadsRunning;
static SDL_AtomicInt threadsRunning;
static SDL_sem *threadDone;
static int SDLCALL adder(void *junk)
@ -255,7 +255,7 @@ static void RunEpicTest(void)
typedef struct
{
SDL_atomic_t sequence;
SDL_AtomicInt sequence;
SDL_Event event;
} SDL_EventQueueEntry;
@ -265,23 +265,23 @@ typedef struct
char cache_pad1[SDL_CACHELINE_SIZE - ((sizeof(SDL_EventQueueEntry) * MAX_ENTRIES) % SDL_CACHELINE_SIZE)];
SDL_atomic_t enqueue_pos;
SDL_AtomicInt enqueue_pos;
char cache_pad2[SDL_CACHELINE_SIZE - sizeof(SDL_atomic_t)];
char cache_pad2[SDL_CACHELINE_SIZE - sizeof(SDL_AtomicInt)];
SDL_atomic_t dequeue_pos;
SDL_AtomicInt dequeue_pos;
char cache_pad3[SDL_CACHELINE_SIZE - sizeof(SDL_atomic_t)];
char cache_pad3[SDL_CACHELINE_SIZE - sizeof(SDL_AtomicInt)];
#ifdef TEST_SPINLOCK_FIFO
SDL_SpinLock lock;
SDL_atomic_t rwcount;
SDL_atomic_t watcher;
SDL_AtomicInt rwcount;
SDL_AtomicInt watcher;
char cache_pad4[SDL_CACHELINE_SIZE - sizeof(SDL_SpinLock) - 2 * sizeof(SDL_atomic_t)];
char cache_pad4[SDL_CACHELINE_SIZE - sizeof(SDL_SpinLock) - 2 * sizeof(SDL_AtomicInt)];
#endif
SDL_atomic_t active;
SDL_AtomicInt active;
/* Only needed for the mutex test */
SDL_mutex *mutex;

View File

@ -23,7 +23,7 @@
static SDL_mutex *mutex = NULL;
static SDL_threadID mainthread;
static SDL_Thread *threads[6];
static SDL_atomic_t doterminate;
static SDL_AtomicInt doterminate;
/**
* SDL_Quit() shouldn't be used with atexit() directly because

View File

@ -28,7 +28,7 @@ typedef struct
{
SDL_AudioDeviceID dev;
int soundpos;
SDL_atomic_t done;
SDL_AtomicInt done;
} callback_data;
static callback_data cbd[64];

View File

@ -20,7 +20,7 @@
#define NUMTHREADS 10
static SDL_atomic_t time_for_threads_to_die[NUMTHREADS];
static SDL_AtomicInt time_for_threads_to_die[NUMTHREADS];
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void