Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove a wrong assert. This condition isn't supposed to be true all the time: I didn...
[simgrid.git] / src / xbt / context.c
index 571b01d..77040cd 100644 (file)
@@ -336,7 +336,7 @@ static void xbt_context_stop(int retvalue) {
 #else
   __xbt_context_yield(current_context);
 #endif
-  xbt_assert0(0, "You can't be here!");
+  THROW_IMPOSSIBLE();
 }
 
 
@@ -361,7 +361,10 @@ void xbt_context_empty_trash(void)
 
 static void __xbt_context_yield(xbt_context_t context)
 {
-  xbt_assert0(current_context, "You have to call context_init() first.");
+#ifdef CONTEXT_THREADS
+  xbt_context_t self;
+#endif  
+xbt_assert0(current_context, "You have to call context_init() first.");        
   xbt_assert0(context,"Invalid argument");
 
   if (current_context == context) {
@@ -373,7 +376,7 @@ static void __xbt_context_yield(xbt_context_t context)
   }
 
 #ifdef CONTEXT_THREADS
-  xbt_context_t self = current_context;
+  self = current_context;
   DEBUG2("[%p] **** Locking ctx %p ****", self, context);
   xbt_os_mutex_lock(context->mutex);
   DEBUG1("[%p] **** Updating current_context ****", self);
@@ -398,7 +401,6 @@ static void __xbt_context_yield(xbt_context_t context)
   int return_value = 0;
 
   if (context->save == NULL) {
-    xbt_assert(context == current_context);
     DEBUG1("[%p] **** Yielding to somebody else ****", current_context);
     DEBUG2("Saving current_context value (%p) to context(%p)->save",
             current_context, context);
@@ -487,10 +489,6 @@ void xbt_context_kill(xbt_context_t context)
 /* Java cruft I'm gonna kill in the next cleanup round */
 void  xbt_context_set_jprocess(xbt_context_t context, void *jp){}
 void* xbt_context_get_jprocess(xbt_context_t context){return NULL;}
-void  xbt_context_set_jmutex(xbt_context_t context,void *jm){}
-void* xbt_context_get_jmutex(xbt_context_t context){return NULL;}
-void  xbt_context_set_jcond(xbt_context_t context,void *jc){}
-void* xbt_context_get_jcond(xbt_context_t context){return NULL;}
 void  xbt_context_set_jenv(xbt_context_t context,void* je){}
 void* xbt_context_get_jenv(xbt_context_t context){return NULL;}