X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/240801b7c05a4efce78f175e114c9def9e16d7a5..fed9d9cc9c216524b967d12066201ed485001550:/tools/tesh/run_context.h diff --git a/tools/tesh/run_context.h b/tools/tesh/run_context.h index 43a55130f9..9b334722be 100644 --- a/tools/tesh/run_context.h +++ b/tools/tesh/run_context.h @@ -19,6 +19,9 @@ typedef enum {e_output_check, e_output_display, e_output_ignore} e_output_handli typedef struct { /* kind of job */ char *cmd; + char **env; + int env_size; + char *filepos; int pid; int is_background:1; int is_empty:1; @@ -31,6 +34,10 @@ typedef struct { the child is dead. The main thread use it to detect that the child is not dead before the end of timeout */ + int interrupted:1; /* Whether we got stopped by an armageddon */ + xbt_os_mutex_t interruption; /* To allow main thread to kill a runner + one only at certain points */ + e_output_handling_t output; int status; @@ -41,12 +48,13 @@ typedef struct { int expected_return; /* the exepeted return code of following command */ /* buffers */ - buff_t input; - buff_t output_wanted; - buff_t output_got; + xbt_strbuff_t input; + xbt_strbuff_t output_wanted; + xbt_strbuff_t output_got; /* Threads */ - xbt_thread_t writer, reader; /* IO handlers */ + xbt_os_thread_t writer, reader; /* IO handlers */ + xbt_os_thread_t runner; /* Main thread, counting for timeouts */ /* Pipes from/to the child */ int child_to, child_from; @@ -60,6 +68,12 @@ void rctx_exit(void); /* wait for all currently running background jobs */ void rctx_wait_bg(void); +/* kill forcefully all currently running background jobs */ +extern rctx_t armageddon_initiator; +extern xbt_os_mutex_t armageddon_mutex; +void rctx_armageddon(rctx_t initiator, int exitcode); + + /* create a new empty running context */ rctx_t rctx_new(void); void rctx_free(rctx_t rctx);