Mercurial > sdl-ios-xcode
diff src/thread/amigaos/SDL_syssem.c @ 1361:19418e4422cb
New configure-based build system. Still work in progress, but much improved
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 16 Feb 2006 10:11:48 +0000 |
parents | c71e05b4dc2e |
children | d910939febfa |
line wrap: on
line diff
--- a/src/thread/amigaos/SDL_syssem.c Fri Feb 10 07:29:08 2006 +0000 +++ b/src/thread/amigaos/SDL_syssem.c Thu Feb 16 10:11:48 2006 +0000 @@ -29,10 +29,6 @@ struct SDL_semaphore { struct SignalSemaphore Sem; - Uint32 count; - Uint32 waiters_count; - SDL_mutex *count_lock; - SDL_cond *count_nonzero; }; #undef D @@ -98,20 +94,9 @@ /* A timeout of 0 is an easy case */ if ( timeout == 0 ) { - return SDL_SemTryWait(sem); + ObtainSemaphore(&sem->Sem); + return 1; } -/* - SDL_LockMutex(sem->count_lock); - ++sem->waiters_count; - retval = 0; - while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) { - retval = SDL_CondWaitTimeout(sem->count_nonzero, - sem->count_lock, timeout); - } - --sem->waiters_count; - --sem->count; - SDL_UnlockMutex(sem->count_lock); -*/ if(!(retval=AttemptSemaphore(&sem->Sem))) { SDL_Delay(timeout); @@ -131,7 +116,6 @@ { ObtainSemaphore(&sem->Sem); return 0; -// return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } Uint32 SDL_SemValue(SDL_sem *sem) @@ -145,7 +129,6 @@ #else value = sem->Sem.ss_NestCount; #endif -// SDL_UnlockMutex(sem->count_lock); } return value; } @@ -159,14 +142,6 @@ D(bug("SemPost semaphore...%lx\n",sem)); ReleaseSemaphore(&sem->Sem); -#if 0 - SDL_LockMutex(sem->count_lock); - if ( sem->waiters_count > 0 ) { - SDL_CondSignal(sem->count_nonzero); - } - ++sem->count; - SDL_UnlockMutex(sem->count_lock); -#endif return 0; }