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
Do throw an exception only when the requested factory was not found, not all the...
[simgrid.git]
/
src
/
xbt
/
xbt_context.c
diff --git
a/src/xbt/xbt_context.c
b/src/xbt/xbt_context.c
index
ea50160
..
8774486
100644
(file)
--- a/
src/xbt/xbt_context.c
+++ b/
src/xbt/xbt_context.c
@@
-244,15
+244,10
@@
xbt_context_select_factory(const char* name)
{
\r
/* if the desired factory is different of the current factory, call xbt_context_mod_exit() */
\r
if(strcmp(context_factory->name,name))
\r
- {
\r
xbt_context_mod_exit();
\r
-
\r
- }
\r
else
\r
- {
\r
/* the same context factory is requested return directly */
\r
return 0;
\r
- }
\r
}
\r
\r
/* get the desired factory */
\r
@@
-277,26
+272,20
@@
xbt_context_select_factory(const char* name)
return 0;
\r
}
\r
\r
-int
\r
+void
\r
xbt_context_init_factory_by_name(xbt_context_factory_t* factory, const char* name)
\r
{
\r
- if(!strcmp(name,"java"))
\r
- {
\r
- return xbt_ctx_java_factory_init(factory);
\r
- }
\r
- #ifdef CONTEXT_THREADS
\r
- else if(!strcmp(name,"thread"))
\r
- {
\r
- return xbt_ctx_thread_factory_init(factory);
\r
- }
\r
- #elif !defined(WIN32)
\r
- else if(!strcmp(name,"sysv"))
\r
- {
\r
- return xbt_ctx_sysv_factory_init(factory);
\r
- }
\r
- #endif
\r
-
\r
- return EINVAL;
\r
+ if(!strcmp(name,"java"))
\r
+ xbt_ctx_java_factory_init(factory);
\r
+#ifdef CONTEXT_THREADS
\r
+ else if(!strcmp(name,"thread"))
\r
+ xbt_ctx_thread_factory_init(factory);
\r
+#elif !defined(WIN32)
\r
+ else if(!strcmp(name,"sysv"))
\r
+ xbt_ctx_sysv_factory_init(factory);
\r
+#endif
\r
+ else
\r
+ THROW1(not_found_error, 0,"Factory '%s' does not exist",name);
\r
}
\r
\r
/** Garbage collection
\r