Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: Protect SIMIX_process_self in the case that the context module is not yet...
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Dec 2010 14:54:09 +0000 (14:54 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Dec 2010 14:54:09 +0000 (14:54 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9016 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/smx_process.c

index ee203f4..f22b2cc 100644 (file)
@@ -25,10 +25,9 @@ static unsigned long simix_process_count = 0;
  */
 XBT_INLINE smx_process_t SIMIX_process_self(void)
 {
-  if (simix_global)
-    return SIMIX_context_get_data(SIMIX_context_self());
+  smx_context_t self_context = SIMIX_context_self();
 
-  return NULL;
+  return self_context ? SIMIX_context_get_data(self_context) : NULL;
 }
 
 /**