Home | History | Annotate | Download | only in pth

Lines Matching defs:mutex

35 /* Create a mutex */
38 SDL_mutex *mutex;
40 /* Allocate mutex memory */
41 mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
42 if ( mutex ) {
43 /* Create the mutex, with initial value signaled */
44 if (!pth_mutex_init(&(mutex->mutexpth_p))) {
45 SDL_SetError("Couldn't create mutex");
46 SDL_free(mutex);
47 mutex = NULL;
52 return(mutex);
55 /* Free the mutex */
56 void SDL_DestroyMutex(SDL_mutex *mutex)
58 if ( mutex ) {
59 SDL_free(mutex);
63 /* Lock the mutex */
64 int SDL_mutexP(SDL_mutex *mutex)
66 if ( mutex == NULL ) {
67 SDL_SetError("Passed a NULL mutex");
71 pth_mutex_acquire(&(mutex->mutexpth_p), FALSE, NULL);
76 /* Unlock the mutex */
77 int SDL_mutexV(SDL_mutex *mutex)
79 if ( mutex == NULL ) {
80 SDL_SetError("Passed a NULL mutex");
84 pth_mutex_release(&(mutex->mutexpth_p));