Home | History | Annotate | Download | only in irix

Lines Matching defs:sem

32 #include <sys/sem.h>
68 SDL_sem *sem;
71 sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
72 if ( sem == NULL ) {
76 sem->id = semget(IPC_PRIVATE, 1, (0600|IPC_CREAT));
77 if ( sem->id < 0 ) {
79 SDL_free(sem);
83 semctl(sem->id, 0, SETVAL, init);
84 return(sem);
87 void SDL_DestroySemaphore(SDL_sem *sem)
89 if ( sem ) {
91 semctl(sem->id, 0, IPC_RMID);
95 semctl(sem->id, 0, IPC_RMID, dummy);
97 SDL_free(sem);
101 int SDL_SemTryWait(SDL_sem *sem)
105 if ( ! sem ) {
112 if ( semop(sem->id, op_trywait, 1) < 0 ) {
121 int SDL_SemWait(SDL_sem *sem)
125 if ( ! sem ) {
132 if ( semop(sem->id, op_wait, 1) < 0 ) {
142 int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
146 if ( ! sem ) {
153 return SDL_SemTryWait(sem);
156 return SDL_SemWait(sem);
162 retval = SDL_SemTryWait(sem);
172 Uint32 SDL_SemValue(SDL_sem *sem)
178 if ( sem ) {
181 semval = semctl(sem->id, 0, GETVAL);
186 semval = semctl(sem->id, 0, GETVAL, arg);
200 int SDL_SemPost(SDL_sem *sem)
204 if ( ! sem ) {
211 if ( semop(sem->id, op_post, 1) < 0 ) {