mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 02:26:13 +00:00
Cleanup
This commit is contained in:
parent
5db093924c
commit
10fe532d29
@ -219,20 +219,18 @@ bool sthread_isself(sthread_t *thread)
|
||||
**/
|
||||
slock_t *slock_new(void)
|
||||
{
|
||||
bool mutex_created = false;
|
||||
slock_t *lock = (slock_t*)calloc(1, sizeof(*lock));
|
||||
if (!lock)
|
||||
return NULL;
|
||||
|
||||
#ifdef USE_WIN32_THREADS
|
||||
lock->lock = CreateMutex(NULL, FALSE, NULL);
|
||||
mutex_created = !!lock->lock;
|
||||
#else
|
||||
mutex_created = (pthread_mutex_init(&lock->lock, NULL) == 0);
|
||||
#endif
|
||||
|
||||
if (!mutex_created)
|
||||
if (!lock->lock)
|
||||
goto error;
|
||||
#else
|
||||
if ((pthread_mutex_init(&lock->lock, NULL) < 0))
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
return lock;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user