mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Update
This commit is contained in:
parent
ff2f2222e5
commit
4c276feb4a
@ -131,6 +131,15 @@ void slock_free(slock_t *lock);
|
|||||||
**/
|
**/
|
||||||
void slock_lock(slock_t *lock);
|
void slock_lock(slock_t *lock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* slock_try_lock:
|
||||||
|
* @lock : pointer to mutex object
|
||||||
|
*
|
||||||
|
* Attempts to lock a mutex. If a mutex is already locked by
|
||||||
|
* another thread, return false. If the lock is acquired, return true.
|
||||||
|
**/
|
||||||
|
bool slock_try_lock(slock_t *lock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* slock_unlock:
|
* slock_unlock:
|
||||||
* @lock : pointer to mutex object
|
* @lock : pointer to mutex object
|
||||||
|
@ -385,6 +385,24 @@ void slock_lock(slock_t *lock)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* slock_try_lock:
|
||||||
|
* @lock : pointer to mutex object
|
||||||
|
*
|
||||||
|
* Attempts to lock a mutex. If a mutex is already locked by
|
||||||
|
* another thread, return false. If the lock is acquired, return true.
|
||||||
|
**/
|
||||||
|
bool slock_try_lock(slock_t *lock)
|
||||||
|
{
|
||||||
|
if (!lock)
|
||||||
|
return false;
|
||||||
|
#ifdef USE_WIN32_THREADS
|
||||||
|
return TryEnterCriticalSection(&lock->lock);
|
||||||
|
#else
|
||||||
|
return pthread_mutex_trylock(&lock->lock)==0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* slock_unlock:
|
* slock_unlock:
|
||||||
* @lock : pointer to mutex object
|
* @lock : pointer to mutex object
|
||||||
|
@ -204,9 +204,9 @@ int filestream_getc(RFILE *stream)
|
|||||||
{
|
{
|
||||||
char c = 0;
|
char c = 0;
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return 0;
|
return EOF;
|
||||||
if(filestream_read(stream, &c, 1) == 1)
|
if (filestream_read(stream, &c, 1) == 1)
|
||||||
return (int)c;
|
return (int)(unsigned char)c;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ int filestream_putc(RFILE *stream, int c)
|
|||||||
char c_char = (char)c;
|
char c_char = (char)c;
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return EOF;
|
return EOF;
|
||||||
return filestream_write(stream, &c_char, 1)==1 ? c : EOF;
|
return filestream_write(stream, &c_char, 1)==1 ? (int)(unsigned char)c : EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
int filestream_vprintf(RFILE *stream, const char* format, va_list args)
|
int filestream_vprintf(RFILE *stream, const char* format, va_list args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user