00001 00012 #include <includes.h> 00013 00014 #ifndef __VERSION_0_1__ 00015 #warning RangerOS mismatch, expected v0.1. 00016 #endif 00017 00025 void mutex_lock(MUTEX* mutex_ptr){ 00026 while (mutex_check(mutex_ptr)){} //block until mutex is unlocked 00027 *mutex_ptr = 1; //locked 00028 } 00029 00036 void mutex_unlock(MUTEX* mutex_ptr){ 00037 *mutex_ptr = 0; //unlocked 00038 } 00039 00047 int mutex_check(MUTEX* mutex_ptr){ 00048 return *mutex_ptr; 00049 }