commit daedcbe98bcbb6ac210d089a5b7aa3cdb1973beb parent 00f777ceef68291978527b9b985d4fd81eea1bd5 Author: Michael Savage <mikejsavage@gmail.com> Date: Mon Sep 14 21:50:37 +0100 Fix Linux semaphores Diffstat:
linux_semaphore.cc | | | 8 | ++++---- |
diff --git a/linux_semaphore.cc b/linux_semaphore.cc @@ -2,20 +2,20 @@ #include <semaphore.h> struct Semaphore { - sem_t * sem; + sem_t sem; }; inline void semaphore_init( Semaphore * const sem ) { - const int ok = sem_init( sem->sem, 0, 0 ); + const int ok = sem_init( &sem->sem, 0, 0 ); if( ok == -1 ) { err( 1, "sem_init failed" ); } } inline void semaphore_signal( Semaphore * const sem ) { - sem_post( sem->sem ); + sem_post( &sem->sem ); } inline void semaphore_wait( Semaphore * const sem ) { - sem_wait( sem->sem ); + sem_wait( &sem->sem ); }