예제 #1
0
/* Create a semaphore */
SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
{
   RSemaphore s;
   TInt status = CreateUnique(NewSema, &s, &initial_value);
   if(status != KErrNone)
	 {
			SDL_SetError("Couldn't create semaphore");
	}
    SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore;  
    sem->handle = s.Handle();
	sem->count = initial_value;
	return(sem);
}
예제 #2
0
void* SemaphoreCreate(int Init)
{
	RSemaphore p;
	p.CreateLocal(Init);
	return (void *)p.Handle();
}