Use althrd_yield instead of alsched_yield
This commit is contained in:
parent
d124aee4d7
commit
184cf30cf7
@ -18,9 +18,6 @@ typedef LONG althread_once_t;
|
||||
#define ALTHREAD_ONCE_INIT 0
|
||||
void althread_once(althread_once_t *once, void (*callback)(void));
|
||||
|
||||
inline int alsched_yield(void)
|
||||
{ SwitchToThread(); return 0; }
|
||||
|
||||
WCHAR *strdupW(const WCHAR *str);
|
||||
|
||||
/* Opens a file with standard I/O. The filename is expected to be UTF-8. */
|
||||
@ -45,8 +42,6 @@ void Sleep(ALuint t);
|
||||
#define ALTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
|
||||
#define althread_once pthread_once
|
||||
|
||||
#define alsched_yield sched_yield
|
||||
|
||||
#define al_fopen(_n, _m) fopen((_n), (_m))
|
||||
|
||||
#if defined(HAVE_DLFCN_H) && !defined(IN_IDE_PARSER)
|
||||
|
@ -311,13 +311,11 @@ void RestoreFPUMode(const FPUCtl *ctl)
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
extern inline int alsched_yield(void);
|
||||
|
||||
void althread_once(althread_once_t *once, void (*callback)(void))
|
||||
{
|
||||
LONG ret;
|
||||
while((ret=InterlockedExchange(once, 1)) == 1)
|
||||
alsched_yield();
|
||||
althrd_yield();
|
||||
if(ret == 0)
|
||||
callback();
|
||||
InterlockedExchange(once, 2);
|
||||
@ -667,7 +665,7 @@ void SetRTPriority(void)
|
||||
static void Lock(volatile ALenum *l)
|
||||
{
|
||||
while(ExchangeInt(l, AL_TRUE) == AL_TRUE)
|
||||
alsched_yield();
|
||||
althrd_yield();
|
||||
}
|
||||
|
||||
static void Unlock(volatile ALenum *l)
|
||||
|
Loading…
Reference in New Issue
Block a user