/* 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); }
void* SemaphoreCreate(int Init) { RSemaphore p; p.CreateLocal(Init); return (void *)p.Handle(); }