- xbt_assert((coroutine_yield != NULL), "Method yield not found.");
- coroutine_yieldTo = (*global_env)->GetStaticMethodID(global_env, coclass, "yieldTo", "(Ljava/dyn/Coroutine;)V");
- xbt_assert((coroutine_yieldTo != NULL), "Method yieldTo not found.");
-
- jclass class_thread = (*global_env)->FindClass(global_env, "java/lang/Thread");
- xbt_assert((class_thread != NULL), "Can't find java.lang.Thread class");
- jclass class_coroutine_support = (*global_env)->FindClass(global_env, "java/dyn/CoroutineSupport");
- xbt_assert((class_coroutine_support != NULL), "Can't find java.dyn.CoroutineSupport class");
- jmethodID thread_get_current = (*global_env)->GetStaticMethodID(global_env, class_thread, "currentThread", "()Ljava/lang/Thread;");
- xbt_assert((thread_get_current != NULL), "Can't find Thread.currentThread() method.");
-
- /**
- * Retrieve maetro coroutine object
- */
- jobject jthread;
- jthread = (*global_env)->CallStaticObjectMethod(global_env, class_thread, thread_get_current);
- xbt_assert((jthread != NULL), "Can't find current thread.");
-
- jmethodID thread_get_coroutine_support = (*global_env)->GetMethodID(global_env, class_thread, "getCoroutineSupport", "()Ljava/dyn/CoroutineSupport;");
- xbt_assert((thread_get_coroutine_support != NULL), "Can't find Thread.getCoroutineSupport method");
-
- jobject jcoroutine_support;
- jcoroutine_support = (*global_env)->CallObjectMethod(global_env, jthread, thread_get_coroutine_support);
- xbt_assert((jcoroutine_support != NULL), "Can't find coroutine support object");
- //FIXME ? Be careful, might change in the implementation (we are relying on private fields, so...).
- jfieldID coroutine_support_thread_coroutine = (*global_env)->GetFieldID(global_env, class_coroutine_support, "threadCoroutine", "Ljava/dyn/Coroutine;");
- xbt_assert((coroutine_support_thread_coroutine != NULL), "Can't find threadCoroutine field");
- cojava_maestro_coroutine = (jobject)(*global_env)->GetObjectField(global_env, jcoroutine_support, coroutine_support_thread_coroutine);
- xbt_assert((cojava_maestro_coroutine != NULL), "Can't find the thread coroutine.");
- cojava_maestro_coroutine = (*global_env)->NewGlobalRef(global_env, cojava_maestro_coroutine);
- xbt_assert((cojava_maestro_coroutine != NULL), "Can't get a global reference to the thread coroutine.");
+ xbt_assert((coroutine_yield != NULL), "Method yield not found.");
+ coroutine_yieldTo = (*global_env)->GetStaticMethodID(global_env, coclass, "yieldTo", "(Ljava/dyn/Coroutine;)V");
+ xbt_assert((coroutine_yieldTo != NULL), "Method yieldTo not found.");
+
+ jclass class_thread = (*global_env)->FindClass(global_env, "java/lang/Thread");
+ xbt_assert((class_thread != NULL), "Can't find java.lang.Thread class");
+
+ jclass class_coroutine_support = (*global_env)->FindClass(global_env, "java/dyn/CoroutineSupport");
+ xbt_assert((class_coroutine_support != NULL), "Can't find java.dyn.CoroutineSupport class");
+ jmethodID thread_get_current = (*global_env)->GetStaticMethodID(global_env, class_thread, "currentThread", "()Ljava/lang/Thread;");
+ xbt_assert((thread_get_current != NULL), "Can't find Thread.currentThread() method.");
+
+ /**
+ * Retrieve maetro coroutine object
+ */
+ jobject jthread;
+ jthread = (*global_env)->CallStaticObjectMethod(global_env, class_thread, thread_get_current);
+ xbt_assert((jthread != NULL), "Can't find current thread.");
+
+ jmethodID thread_get_coroutine_support = (*global_env)->GetMethodID(global_env, class_thread, "getCoroutineSupport", "()Ljava/dyn/CoroutineSupport;");
+ xbt_assert((thread_get_coroutine_support != NULL), "Can't find Thread.getCoroutineSupport method");
+
+ jobject jcoroutine_support;
+ jcoroutine_support = (*global_env)->CallObjectMethod(global_env, jthread, thread_get_coroutine_support);
+ xbt_assert((jcoroutine_support != NULL), "Can't find coroutine support object");
+ //FIXME ? Be careful, might change in the implementation (we are relying on private fields, so...).
+ jfieldID coroutine_support_thread_coroutine = (*global_env)->GetFieldID(global_env, class_coroutine_support, "threadCoroutine", "Ljava/dyn/Coroutine;");
+ xbt_assert((coroutine_support_thread_coroutine != NULL), "Can't find threadCoroutine field");
+ cojava_maestro_coroutine = (jobject)(*global_env)->GetObjectField(global_env, jcoroutine_support, coroutine_support_thread_coroutine);
+ xbt_assert((cojava_maestro_coroutine != NULL), "Can't find the thread coroutine.");
+ cojava_maestro_coroutine = (*global_env)->NewGlobalRef(global_env, cojava_maestro_coroutine);
+ xbt_assert((cojava_maestro_coroutine != NULL), "Can't get a global reference to the thread coroutine.");