X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6760cb07d6b57be16928d95339d71e57c4e24f36..e23b481e91e2c7020856a88e25cb6f4fe1358e1f:/src/simdag/sd_workstation.c diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index 9e9b2a868d..d2a00e1a7a 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -498,3 +498,18 @@ void __SD_workstation_destroy(void *workstation) } xbt_free(w); } + +/** + * \brief Returns the kind of the task currently running on a workstation + * Only call this with sequential access mode set + * \param workstation a workstation */ +SD_task_t SD_workstation_get_current_task(SD_workstation_t workstation) +{ + SD_CHECK_INIT_DONE(); + xbt_assert0(workstation != NULL, "Invalid parameter"); + xbt_assert0(workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS, + "Access mode must be set to SD_WORKSTATION_SEQUENTIAL_ACCESS" + " to use this function"); + + return (workstation->current_task); +}