XBT_LOG_NEW_DEFAULT_CATEGORY(jmsg,"MSG for Java(TM)");
-/* header for windows */
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <pthread.h>
-#endif
-
#include "jmsg.h"
static JavaVM * __java_vm = NULL;
-
-#ifdef WIN32
- static DWORD __current_thread_id = 0;
-
- int is_main_thread() {
- return (GetCurrentThreadId() == __current_thread_id);
- }
-
-#else /* !WIN32 */
-
- static pthread_t __current_thread_id = 0;
-
- int is_main_thread() {
- return (pthread_self() == __current_thread_id);
- }
-#endif
-
JavaVM *
get_java_VM(void) {
return __java_vm;
env);
SIMIX_jprocess_create(process->name,
- process->simdata->m_host->simdata->s_host,
+ process->simdata->m_host->simdata->smx_host,
/*data*/ (void*)process,
jprocess,env,
&process->simdata->s_process);
free(argv);
-#ifdef WIN32
- __current_thread_id = GetCurrentThreadId();
-#else
- __current_thread_id = pthread_self();
-#endif
-
-(*env)->GetJavaVM(env,&__java_vm);
+ (*env)->GetJavaVM(env,&__java_vm);
}
JNIEXPORT void JNICALL
Java_simgrid_msg_Msg_waitSignal(JNIEnv* env, jclass cls, jobject jprocess) {
- xbt_os_mutex_t creation_mutex = xbt_creation_mutex_get();
- xbt_os_cond_t creation_cond = xbt_creation_cond_get();
- xbt_os_mutex_lock(creation_mutex);
- xbt_os_cond_signal( creation_cond );
- xbt_os_mutex_unlock( creation_mutex );
-
}
JNIEXPORT void JNICALL