/* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* each context implementation define its own context factory
* a context factory is responsable of the creation of the context
* associated with the maestro and of all the context based on
* each context implementation define its own context factory
* a context factory is responsable of the creation of the context
* associated with the maestro and of all the context based on
/* remove the context of the scheduler from the list of the contexts in use */
xbt_swag_remove(maestro_context, context_living);
/* remove the context of the scheduler from the list of the contexts in use */
xbt_swag_remove(maestro_context, context_living);
* kill all the contexts in use :
* the killed contexts are added in the list of the contexts to destroy
*/
* kill all the contexts in use :
* the killed contexts are added in the list of the contexts to destroy
*/
/*******************************/
/* Object creation/destruction */
/*******************************/
/*******************************/
/* Object creation/destruction */
/*******************************/
* \param code a main function
* \param startup_func a function to call when running the context for
* the first time and just before the main function \a code
* \param startup_arg the argument passed to the previous function (\a startup_func)
* \param code a main function
* \param startup_func a function to call when running the context for
* the first time and just before the main function \a code
* \param startup_arg the argument passed to the previous function (\a startup_func)
the termination of the main function \a code
* \param cleanup_arg the argument passed to the previous function (\a cleanup_func)
* \param argc first argument of function \a code
the termination of the main function \a code
* \param cleanup_arg the argument passed to the previous function (\a cleanup_func)
* \param argc first argument of function \a code
* CASE 1: death after end of function
* __context_wrapper, called by os thread, calls xbt_context_stop after user code stops
* xbt_context_stop calls user cleanup_func if any (in context settings),
* add current to trashbin
* yields back to maestro (destroy os thread on need)
* CASE 1: death after end of function
* __context_wrapper, called by os thread, calls xbt_context_stop after user code stops
* xbt_context_stop calls user cleanup_func if any (in context settings),
* add current to trashbin
* yields back to maestro (destroy os thread on need)
* At the end of it, it checks that wannadie == 1, and call xbt_context_stop
* (same than first case afterward)
*/
* At the end of it, it checks that wannadie == 1, and call xbt_context_stop
* (same than first case afterward)
*/
however run effectively only when calling #xbt_context_schedule
*/
void xbt_context_start(xbt_context_t context)
however run effectively only when calling #xbt_context_schedule
*/
void xbt_context_start(xbt_context_t context)
* Calling this function makes the current context yield. The context
* that scheduled it returns from xbt_context_schedule as if nothing
* had happened.
* Calling this function makes the current context yield. The context
* that scheduled it returns from xbt_context_schedule as if nothing
* had happened.
* When \a context will call xbt_context_yield, it will return
* to this function as if nothing had happened.
* When \a context will call xbt_context_yield, it will return
* to this function as if nothing had happened.
* Only the maestro can call this function to run a given process.
*/
void xbt_context_schedule(xbt_context_t context)
* Only the maestro can call this function to run a given process.
*/
void xbt_context_schedule(xbt_context_t context)