Example #1
0
void LockLeave(void* Handle)
{
	lock_t *lock = (lock_t *)Handle;
    if (lock && --lock->Counter == 0)
    {
        lock->Thread = 0;
    	RMutex p;
	    p.SetHandle(lock->Handle);
	    p.Signal();
    }
}
Example #2
0
/* Unlock the mutex */
int SDL_mutexV(SDL_mutex *mutex)
{
	if ( mutex == NULL ) {
		SDL_SetError("Passed a NULL mutex");
		return -1;
	}
	RMutex rmutex;
    rmutex.SetHandle(mutex->handle);
	rmutex.Signal();
	return(0);
}
Example #3
0
void LockDelete(void* Handle)
{
	lock_t *lock = (lock_t *)Handle;
    if (lock)
    {
	    RMutex p;
	    p.SetHandle(lock->Handle);
	    p.Close();
        free(lock);
    }
}
Example #4
0
/* Free the mutex */
void SDL_DestroyMutex(SDL_mutex *mutex)
{
	if ( mutex ) 
	{
    RMutex rmutex;
    rmutex.SetHandle(mutex->handle);
	rmutex.Signal();
	rmutex.Close();
	delete(mutex);
    mutex = NULL;
	}
}
Example #5
0
bool_t ConditionWait(void* Handle,int Tick,void* Lock)
{
	RCondVar p;
	RMutex m;	
	p.SetHandle((int)Handle);
	m.SetHandle((int)Lock);
	// Increase the tick by one to mimic other platforms
	// which is -1 = Wait forever, 0 = Return
	// For Symbian, 0 = Wait forever
	Tick++;		
	return p.TimedWait(m, Tick*1000) == KErrNone;
}
Example #6
0
/* Free the mutex */
void SDL_DestroyMutex(SDL_mutex *mutex)
{
	if ( mutex ) 
	{
    RMutex rmutex;
    rmutex.SetHandle(mutex->handle);
    if(rmutex.IsHeld())
        {
	    rmutex.Signal();
        }
	rmutex.Close();
	EpocSdlEnv::RemoveCleanupItem(mutex);
	delete(mutex);
    mutex = NULL;
	}
}
Example #7
0
void LockEnter(void* Handle)
{
	lock_t *lock = (lock_t *)Handle;
    if (lock)
    {
        RThread current;
        TUint currentId = current.Id();
        if (lock->Thread == currentId)
            ++lock->Counter;
        else
        {
	        RMutex p;
	        p.SetHandle(lock->Handle);
	        p.Wait();
            assert(lock->Counter==0);
            lock->Counter = 1;
            lock->Thread = currentId;
        }
    }
}
Example #8
0
void LockLeave(void* Handle)
{
	RMutex p;
	p.SetHandle((int)Handle);
	p.Signal();
}
Example #9
0
void LockEnter(void* Handle)
{
	RMutex p;
	p.SetHandle((int)Handle);
	p.Wait();
}
Example #10
0
void LockDelete(void* Handle)
{
	RMutex p;
	p.SetHandle((int)Handle);
	p.Close();
}