Пример #1
0
/* Free the semaphore */
void SDL_DestroySemaphore(SDL_sem *sem)
{
	if ( sem ) 
	{
    RSemaphore sema;
    sema.SetHandle(sem->handle);
	sema.Signal(sema.Count());
    sema.Close();
    delete sem;
	sem = NULL;
	}
}
Пример #2
0
bool_t SemaphoreWait(void* Handle,int Tick)
{
	RSemaphore p;	
	p.SetHandle((int)Handle);
    if (Tick>=0)
    {
#if defined(SYMBIAN90)
        return p.Wait(Tick*1000) == KErrNone;
#else
        //!!! todo 
#endif
    }
    p.Wait();
    return 1;
}
Пример #3
0
/* Free the semaphore */
void SDL_DestroySemaphore(SDL_sem *sem)
{
	if ( sem ) 
	{
    RSemaphore sema;
    sema.SetHandle(sem->handle);
#if !defined (UIQ3) && !defined(S60V3)
	sema.Signal(sema.Count());
#else
	sema.Signal(sem->count);
#endif
    sema.Close();
    delete sem;
	sem = NULL;
	}
}
Пример #4
0
void SemaphoreRelease(void* Handle,int n)
{
	RSemaphore p;
	p.SetHandle((int)Handle);
	p.Signal(n);			
}
Пример #5
0
void SemaphoreClose(void* Handle)
{
	RSemaphore p;
	p.SetHandle((int)Handle);
	p.Close();	
}