Next Thread | Thread List | Previous Thread Start a Thread | Settings
who unlock the mutex f1() or f2() ?function f1() should unlock the mutex, is this right ?
#include <rtl.h>
OS_MUT mutex;
void f1 (void){ os_mut_wait (mutex, 0xffff); f2 (); .. /* Critical region 1 */ ..os_mut_release (mutex);}
void f2 (void){ os_mut_wait (mutex1, 0xffff); .. /* Critical region 2 */ .. os_mut_release (mutex1);}
__task void task1 (void){ os_mut_init (mutex); f1 (); ..}
thanks,willi
yes.
however you could have read the answer in http://www.keil.com/support/man/docs/rlarm/rlarm_os_mut_release.htm