summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c36bb69)
- one letter variables are harder to read
- remove a useless assert (the system will complain if it's null)
- improve some debug messages and comments
// adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
// correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
// and according to the JAVA document, the only exception that can be triggered by MSG_Process_sleep call.
// adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
// correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
// and according to the JAVA document, the only exception that can be triggered by MSG_Process_sleep call.
- // To avoid possible impacts in the code, I just raised a host_failure execption for the moment in the JAVA code
+ // To avoid possible impacts in the code, I just raised a host_failure exception for the moment in the JAVA code
// and did not change anythings at the C level.
// See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
status = MSG_TASK_CANCELED;
// and did not change anythings at the C level.
// See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
status = MSG_TASK_CANCELED;
#endif
/******************************** Exceptions *********************************/
#endif
/******************************** Exceptions *********************************/
-
-#define SMX_EXCEPTION(issuer, c, v, m) \
+/** @brief Ask to the provided simix process to raise the provided exception */
+#define SMX_EXCEPTION(issuer, cat, val, msg) \
- smx_process_t _smx_throw_issuer = (issuer); \
- THROW_PREPARE(_smx_throw_issuer->running_ctx, (c), (v), xbt_strdup(m)); \
+ smx_process_t _smx_throw_issuer = (issuer); /* evaluate only once */\
+ THROW_PREPARE(_smx_throw_issuer->running_ctx, (cat), (val), xbt_strdup(msg)); \
_smx_throw_issuer->doexception = 1; \
} else ((void)0)
_smx_throw_issuer->doexception = 1; \
} else ((void)0)
void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
{
void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
{
- xbt_assert((process != NULL), "Invalid parameters");
-
XBT_IN("process = %p, issuer = %p", process, issuer);
if(process->context->iwannadie) {
XBT_IN("process = %p, issuer = %p", process, issuer);
if(process->context->iwannadie) {
if (self->suspended) {
XBT_DEBUG("Hey! I'm suspended.");
if (self->suspended) {
XBT_DEBUG("Hey! I'm suspended.");
- xbt_assert(!self->doexception, "Gloups! This exception may be lost by subsequent calls.");
+ xbt_assert(!self->doexception, "Gasp! This exception may be lost by subsequent calls.");
self->suspended = 0;
SIMIX_process_suspend(self, self);
}
self->suspended = 0;
SIMIX_process_suspend(self, self);
}
/* the externally visible API */
XBT_EXPORT_NO_IMPORT(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
/* the externally visible API */
XBT_EXPORT_NO_IMPORT(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
-XBT_EXPORT_NO_IMPORT(ex_term_cb_t) __xbt_ex_terminate =
- &__xbt_ex_terminate_default;
+XBT_EXPORT_NO_IMPORT(ex_term_cb_t) __xbt_ex_terminate = &__xbt_ex_terminate_default;
void xbt_ex_free(xbt_ex_t e)
void xbt_ex_free(xbt_ex_t e)