/********************************* Condition **********************************/
-/**
- * \brief Initialize a condition.
- *
- * Allocates and creates the data for the condition.
- * It have to be called before the use of the condition.
- * \return A condition
- */
-smx_cond_t SIMIX_cond_init()
-{
- XBT_IN("()");
- smx_cond_t cond = new simgrid::kernel::activity::ConditionVariableImpl();
- XBT_OUT();
- return cond;
-}
-
/**
* \brief Handle a condition waiting simcall without timeouts
*/
} // namespace activity
} // namespace kernel
} // namespace simgrid
-XBT_PRIVATE smx_cond_t SIMIX_cond_init();
#endif
*/
smx_cond_t simcall_cond_init()
{
- return simcall_BODY_cond_init();
+ return simgrid::simix::kernelImmediate([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
}
/**
simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
}
-static inline smx_cond_t simcall_cond_init__get__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<smx_cond_t>(simcall->result);
-}
-static inline smx_cond_t simcall_cond_init__getraw__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->result);
-}
-static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_cond_t result)
-{
- simgrid::simix::marshal<smx_cond_t>(simcall->result, result);
-}
-
static inline smx_cond_t simcall_cond_wait__get__cond(smx_simcall_t simcall)
{
return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
}
-inline static smx_cond_t simcall_BODY_cond_init()
-{
- if (0) /* Go to that function to follow the code flow through the simcall barrier */
- SIMIX_cond_init();
- return simcall<smx_cond_t>(SIMCALL_COND_INIT);
-}
-
inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
{
if (0) /* Go to that function to follow the code flow through the simcall barrier */
SIMCALL_MUTEX_LOCK,
SIMCALL_MUTEX_TRYLOCK,
SIMCALL_MUTEX_UNLOCK,
- SIMCALL_COND_INIT,
SIMCALL_COND_WAIT,
SIMCALL_COND_WAIT_TIMEOUT,
SIMCALL_SEM_ACQUIRE,
"SIMCALL_MUTEX_LOCK",
"SIMCALL_MUTEX_TRYLOCK",
"SIMCALL_MUTEX_UNLOCK",
- "SIMCALL_COND_INIT",
"SIMCALL_COND_WAIT",
"SIMCALL_COND_WAIT_TIMEOUT",
"SIMCALL_SEM_ACQUIRE",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_COND_INIT:
- simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_COND_WAIT:
simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
break;
int mutex_trylock(smx_mutex_t mutex);
void mutex_unlock(smx_mutex_t mutex);
-smx_cond_t cond_init() [[nohandler]];
void cond_wait(smx_cond_t cond, smx_mutex_t mutex) [[block]];
void cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) [[block]];