This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX mutex

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