A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
bindings
/
java
/
JavaContext.hpp
diff --git
a/src/bindings/java/JavaContext.hpp
b/src/bindings/java/JavaContext.hpp
index
fbad882
..
9a07ff8
100644
(file)
--- a/
src/bindings/java/JavaContext.hpp
+++ b/
src/bindings/java/JavaContext.hpp
@@
-7,13
+7,15
@@
#ifndef SIMGRID_JAVA_JAVA_CONTEXT_HPP
#define SIMGRID_JAVA_JAVA_CONTEXT_HPP
#ifndef SIMGRID_JAVA_JAVA_CONTEXT_HPP
#define SIMGRID_JAVA_JAVA_CONTEXT_HPP
+#include <functional>
+
#include <jni.h>
#include <xbt/misc.h>
#include <simgrid/simix.h>
#include <xbt/xbt_os_thread.h>
#include <jni.h>
#include <xbt/misc.h>
#include <simgrid/simix.h>
#include <xbt/xbt_os_thread.h>
-#include "src/simix/smx_private.h
pp
"
+#include "src/simix/smx_private.h"
#include "jmsg.h"
#include "jmsg_process.h"
#include "jmsg.h"
#include "jmsg_process.h"
@@
-27,18
+29,17
@@
class JavacontextFactory;
class JavaContext : public simgrid::simix::Context {
public:
// The java process instance bound with the msg process structure:
class JavaContext : public simgrid::simix::Context {
public:
// The java process instance bound with the msg process structure:
- jobject jprocess;
+ jobject jprocess
= nullptr
;
// JNI interface pointer associated to this thread:
// JNI interface pointer associated to this thread:
- JNIEnv *jenv;
- xbt_os_thread_t thread;
+ JNIEnv *jenv
= nullptr
;
+ xbt_os_thread_t thread
= nullptr
;
// Sempahore used to schedule/yield the process:
// Sempahore used to schedule/yield the process:
- xbt_os_sem_t begin;
+ xbt_os_sem_t begin
= nullptr
;
// Semaphore used to schedule/unschedule the process:
// Semaphore used to schedule/unschedule the process:
- xbt_os_sem_t end;
+ xbt_os_sem_t end
= nullptr
;
public:
friend class JavaContextFactory;
public:
friend class JavaContextFactory;
- JavaContext(xbt_main_func_t code,
- int argc, char **argv,
+ JavaContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
smx_process_t process);
~JavaContext() override;
void_pfn_smxprocess_t cleanup_func,
smx_process_t process);
~JavaContext() override;
@@
-54,14
+55,13
@@
public:
JavaContextFactory();
~JavaContextFactory() override;
JavaContext* self() override;
JavaContextFactory();
~JavaContextFactory() override;
JavaContext* self() override;
- JavaContext* create_context(
- xbt_main_func_t, int, char **, void_pfn_smxprocess_t,
- smx_process_t process
- ) override;
+ JavaContext* create_context(std::function<void()> code,
+ void_pfn_smxprocess_t, smx_process_t process) override;
void run_all() override;
};
XBT_PRIVATE simgrid::simix::ContextFactory* java_factory();
void run_all() override;
};
XBT_PRIVATE simgrid::simix::ContextFactory* java_factory();
+XBT_PRIVATE void java_main_jprocess(jobject process);
}
}
}
}