1 /* Copyright (c) 2009, 2010, 2012. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _XBT_CONTEXT_JAVA_H
8 #define _XBT_CONTEXT_JAVA_H
11 #include <simgrid/simix.h>
12 #include <xbt/xbt_os_thread.h>
15 #include "jmsg_process.h"
19 typedef struct s_smx_ctx_java {
20 s_smx_ctx_base_t super; /* Fields of super implementation */
21 jobject jprocess; /* the java process instance binded with the msg process structure */
22 JNIEnv *jenv; /* jni interface pointer associated to this thread */
23 xbt_os_thread_t thread;
24 xbt_os_sem_t begin; /* this semaphore is used to schedule/yield the process */
25 xbt_os_sem_t end; /* this semaphore is used to schedule/unschedule the process */
26 } s_smx_ctx_java_t, *smx_ctx_java_t;
28 void SIMIX_ctx_java_factory_init(smx_context_factory_t *factory);
29 void smx_ctx_java_stop(smx_context_t context);
30 smx_context_t smx_ctx_java_self(void);
33 #endif /* !_XBT_CONTEXT_JAVA_H */