Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the coupling between java bindings and main lib. Core of issues, SIMIX_context...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Nov 2010 21:45:03 +0000 (21:45 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Nov 2010 21:45:03 +0000 (21:45 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8692 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/private.h
src/simix/smx_context.c
src/simix/smx_context_java.h

index 824a932..653575e 100644 (file)
@@ -215,19 +215,11 @@ void SIMIX_context_mod_init(void);
 
 void SIMIX_context_mod_exit(void);
 
 
 void SIMIX_context_mod_exit(void);
 
-/* Selects a context factory associated with the name specified by the parameter name.
- * If successful the function returns 0. Otherwise the function returns the error code.
- */
-int SIMIX_context_select_factory(const char *name);
 
 /* All factories init */
 void SIMIX_ctx_thread_factory_init(smx_context_factory_t * factory);
 
 /* All factories init */
 void SIMIX_ctx_thread_factory_init(smx_context_factory_t * factory);
-
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t * factory);
 
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t * factory);
 
-
-void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory);
-
 /* ****************************** */
 /* context manipulation functions */
 /* ****************************** */
 /* ****************************** */
 /* context manipulation functions */
 /* ****************************** */
index 59638fa..c6b9a39 100644 (file)
@@ -52,62 +52,3 @@ void SIMIX_context_mod_exit(void)
     (*finalize_factory) (&simix_global->context_factory);
   }
 }
     (*finalize_factory) (&simix_global->context_factory);
   }
 }
-
-/**
- * This function is used to change the context factory.
- * Warning: it destroy all the existing processes (even for maestro), and it
- * will create a new maestro process using the new context factory.
- */
-int SIMIX_context_select_factory(const char *name)
-{
-  /* if a context factory is already instantiated and it is different from the
-     newly selected one, then kill all the processes, exit the context module
-     and initialize the new factory.
-   */
-
-
-  if (simix_global->context_factory != NULL) {
-    if (strcmp(simix_global->context_factory->name, name)) {
-
-      SIMIX_process_killall();
-
-      /* kill maestro process */
-      SIMIX_context_free(simix_global->maestro_process->context);
-      free(simix_global->maestro_process);
-      simix_global->maestro_process = NULL;
-
-      SIMIX_context_mod_exit();
-    } else
-      /* the same context factory is requested return directly */
-      return 0;
-  }
-
-  /* init the desired factory */
-  smx_context_factory_t * factory = &simix_global->context_factory;
-  if (!strcmp(name, "thread"))
-#ifdef CONTEXT_THREADS
-    SIMIX_ctx_thread_factory_init(factory);
-#else
-    THROW0(not_found_error, 0,
-           "Factory 'thread' does not exist: thread support was not compiled in the SimGrid library");
-#endif                          /* CONTEXT_THREADS */
-
-  else if (!strcmp(name, "sysv"))
-#if !defined(_XBT_WIN32) && !defined(CONTEXT_THREADS)
-    SIMIX_ctx_sysv_factory_init(factory);
-#else
-    THROW0(not_found_error, 0,
-           "Factory 'sysv' does not exist: no System V thread support under Windows");
-#endif
-
-  else
-    THROW1(not_found_error, 0, "Factory '%s' does not exist", name);
-
-
-
-
-  SIMIX_create_maestro_process();
-
-  return 0;
-}
-
index 5062715..a60ae04 100644 (file)
@@ -21,6 +21,7 @@ typedef struct s_smx_ctx_java {
   jobject jprocess;             /* the java process instance binded with the msg process structure                                                      */
   JNIEnv *jenv;                 /* jni interface pointer associated to this thread                                                                                      */
 } s_smx_ctx_java_t, *smx_ctx_java_t;
   jobject jprocess;             /* the java process instance binded with the msg process structure                                                      */
   JNIEnv *jenv;                 /* jni interface pointer associated to this thread                                                                                      */
 } s_smx_ctx_java_t, *smx_ctx_java_t;
+void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory);
 
 SG_END_DECL()
 #endif                          /* !_XBT_CONTEXT_JAVA_H */
 
 SG_END_DECL()
 #endif                          /* !_XBT_CONTEXT_JAVA_H */