X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c17057f5df312c247010140721caf078c45e927a..7555d51e10906e1e1d50be93e2b415cc24bbeeee:/src/xbt/xbt_context.c diff --git a/src/xbt/xbt_context.c b/src/xbt/xbt_context.c index ea501608c7..8774486165 100644 --- a/src/xbt/xbt_context.c +++ b/src/xbt/xbt_context.c @@ -244,15 +244,10 @@ xbt_context_select_factory(const char* name) { /* if the desired factory is different of the current factory, call xbt_context_mod_exit() */ if(strcmp(context_factory->name,name)) - { xbt_context_mod_exit(); - - } else - { /* the same context factory is requested return directly */ return 0; - } } /* get the desired factory */ @@ -277,26 +272,20 @@ xbt_context_select_factory(const char* name) return 0; } -int +void xbt_context_init_factory_by_name(xbt_context_factory_t* factory, const char* name) { - if(!strcmp(name,"java")) - { - return xbt_ctx_java_factory_init(factory); - } - #ifdef CONTEXT_THREADS - else if(!strcmp(name,"thread")) - { - return xbt_ctx_thread_factory_init(factory); - } - #elif !defined(WIN32) - else if(!strcmp(name,"sysv")) - { - return xbt_ctx_sysv_factory_init(factory); - } - #endif - - return EINVAL; + if(!strcmp(name,"java")) + xbt_ctx_java_factory_init(factory); +#ifdef CONTEXT_THREADS + else if(!strcmp(name,"thread")) + xbt_ctx_thread_factory_init(factory); +#elif !defined(WIN32) + else if(!strcmp(name,"sysv")) + xbt_ctx_sysv_factory_init(factory); +#endif + else + THROW1(not_found_error, 0,"Factory '%s' does not exist",name); } /** Garbage collection