A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Factorize code for xbt_dynar_shrink/_xbt_dynar_expand.
[simgrid.git]
/
src
/
simix
/
smx_process.c
diff --git
a/src/simix/smx_process.c
b/src/simix/smx_process.c
index
f2f550c
..
d4bb60a
100644
(file)
--- a/
src/simix/smx_process.c
+++ b/
src/simix/smx_process.c
@@
-8,7
+8,6
@@
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "xbt/dict.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "xbt/dict.h"
-#include "msg/mailbox.h"
#include "mc/mc.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
#include "mc/mc.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
@@
-100,15
+99,12
@@
void SIMIX_process_empty_trash(void)
SIMIX_context_free(process->context);
/* Free the exception allocated at creation time */
SIMIX_context_free(process->context);
/* Free the exception allocated at creation time */
- if (process->running_ctx)
- free(process->running_ctx);
- if (process->properties)
- xbt_dict_free(&process->properties);
+ free(process->running_ctx);
+ xbt_dict_free(&process->properties);
xbt_fifo_free(process->comms);
free(process->name);
xbt_fifo_free(process->comms);
free(process->name);
- process->name = NULL;
free(process);
}
}
free(process);
}
}
@@
-190,6
+186,7
@@
void SIMIX_process_create(smx_process_t *process,
(*process)->smx_host = host;
(*process)->data = data;
(*process)->comms = xbt_fifo_new();
(*process)->smx_host = host;
(*process)->data = data;
(*process)->comms = xbt_fifo_new();
+ (*process)->request.issuer = *process;
XBT_VERB("Create context %s", (*process)->name);
(*process)->context = SIMIX_context_new(code, argc, argv,
XBT_VERB("Create context %s", (*process)->name);
(*process)->context = SIMIX_context_new(code, argc, argv,
@@
-417,18
+414,21
@@
int SIMIX_process_count(void)
return xbt_swag_size(simix_global->process_list);
}
return xbt_swag_size(simix_global->process_list);
}
-void* SIMIX_process_self_get_data(
void
)
+void* SIMIX_process_self_get_data(
smx_process_t self
)
{
{
- smx_process_t me = SIMIX_process_self();
- if (!me) {
+ xbt_assert(self == SIMIX_process_self(), "This is not the current process");
+
+ if (!self) {
return NULL;
}
return NULL;
}
- return SIMIX_process_get_data(
me
);
+ return SIMIX_process_get_data(
self
);
}
}
-void SIMIX_process_self_set_data(void *data)
+void SIMIX_process_self_set_data(
smx_process_t self,
void *data)
{
{
- SIMIX_process_set_data(SIMIX_process_self(), data);
+ xbt_assert(self == SIMIX_process_self(), "This is not the current process");
+
+ SIMIX_process_set_data(self, data);
}
void* SIMIX_process_get_data(smx_process_t process)
}
void* SIMIX_process_get_data(smx_process_t process)
@@
-572,13
+572,15
@@
void SIMIX_process_sleep_resume(smx_action_t action)
}
/**
}
/**
- * Calling this function makes the process to yield.
- * Only the processes can call this function, giving back the control to maestro
+ * \brief Calling this function makes the process to yield.
+ *
+ * Only the current process can call this function, giving back the control to
+ * maestro.
+ *
+ * \param self the current process
*/
*/
-void SIMIX_process_yield(
void
)
+void SIMIX_process_yield(
smx_process_t self
)
{
{
- smx_process_t self = SIMIX_process_self();
-
XBT_DEBUG("Yield process '%s'", self->name);
/* Go into sleep and return control to maestro */
XBT_DEBUG("Yield process '%s'", self->name);
/* Go into sleep and return control to maestro */