00001 /* 00002 @file mutex.h 00003 00004 @author Nicolas Williamson 00005 @date January 2010 00006 00007 */ 00008 00009 #ifndef __H_MUTEX__ 00010 #define __H_MUTEX__ 00011 00016 typedef volatile unsigned int MUTEX; 00017 00018 //Functions 00019 void mutex_lock(MUTEX* mutex_ptr); //Blocking; locks the mutex, waiting for the mutex to become unlocked if necessary 00020 void mutex_unlock(MUTEX* mutex_ptr); //unlocks the mutex if it was locked, does nothing otherwise 00021 int mutex_check(MUTEX* mutex_ptr); //returns true (1) if the mutex is locked, false (0) otherwise 00022 00023 #endif