Function mutex_recursive_take

Source
pub unsafe extern "C" fn mutex_recursive_take(
    mutex: mutex_t,
    timeout: u32,
) -> bool
Expand description

Takes a recursive mutex.

\param mutex A mutex handle created by mutex_recursive_create \param wait_time Amount of time to wait before timing out

\return 1 if the mutex was obtained, 0 otherwise

\b Example: \code mutex_t mutex = mutex_recursive_create();

void task_fn(void* param) { while(1) { mutex_recursive_take(mutex, 1000); // critical section mutex_recursive_give(mutex); task_delay(1000); } } task_create(task_fn, (void*)“PROS”, TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, “task_fn”);

\endcode