bool thread_b_is_empty_datap(/* THREAD_ID tid, */ ) { bool result = false; ///////////////////////////////////////////////////////////////////////// // here is where we would branch based on thread instance id. // For now we support only one thread instance per thread implementation. // In this case we would split on destination thread id: thread_b_instance_1 ///////////////////////////////////////////////////////////////////////// rtos_mutex_lock(MUTEX_ID_MUTEX_DATAP_INSTANCE_1); result = false; rtos_mutex_unlock(MUTEX_ID_MUTEX_DATAP_INSTANCE_1); return result; }
bool thread_a_write_foo_data(/* THREAD_ID tid, */ const test__dt_rec * elem ) { bool result = true; ///////////////////////////////////////////////////////////////////////// // here is where we would branch based on thread instance id. // For now we support only one thread instance per thread implementation. // In this case we would split on destination thread id: thread_a_instance_0 ///////////////////////////////////////////////////////////////////////// rtos_mutex_lock(MUTEX_ID_MUTEX_DATAP_INSTANCE_1); memcpy(&var_datap_Instance_1, elem, sizeof(test__dt_rec )); rtos_mutex_unlock(MUTEX_ID_MUTEX_DATAP_INSTANCE_1); return result; }
virtual void lock () { rtos_mutex_lock( &m ); }