-
Notifications
You must be signed in to change notification settings - Fork 63
/
mac_javabridge_utils.h
107 lines (81 loc) · 3.06 KB
/
mac_javabridge_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* mac_javabridge_utils.c - Utilities for managing the Java Bridge on OS/X
CellProfiler is distributed under the GNU General Public License,
but this file is licensed under the more permissive BSD license.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2012 Broad Institute
All rights reserved.
Please see the AUTHORS file for credits.
Website: http://www.cellprofiler.org
See http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html
for JNI documentation.
*/
#include "jni.h"
/**********************************************************
*
* MacStartVM
*
* Start the VM on its own thread, instantiate the thread's runnable
* and run it until exit.
*
* pVMArgs - a pointer to a JavaVMInitArgs structure
* as documented for JNI_CreateJavaVM
*
* Returns only after the thread terminates. Exit code other
* than zero indicates failure.
**********************************************************/
JNIEXPORT int MacStartVM(JavaVM **pVM, JavaVMInitArgs *pVMArgs,
const char *class_name, const char *path_to_libjvm,
const char *path_to_libjli);
/**********************************************************
*
* Stop the JVM
*
*
**********************************************************/
JNIEXPORT void MacStopVM();
/**********************************************************
*
* Initialize the run loop and synchronization variables
*
**********************************************************/
JNIEXPORT void MacRunLoopInit();
/**********************************************************
*
* Enter the Mac's run loop
*
**********************************************************/
JNIEXPORT void MacRunLoopRun();
/*************************************************************************
*
* MacRunLoopReset - reset the run loop state to before start
*
*************************************************************************/
JNIEXPORT void MacRunLoopReset();
/**********************************************************
*
* Signal the run loop to stop from some thread
*
**********************************************************/
JNIEXPORT void MacStopRunLoop();
/***************************************************************
*
* MacIsMainThread - return true if the run loop of this thread
* is the main run loop
*
***************************************************************/
JNIEXPORT int MacIsMainThread();
/*************************************************************************
*
* MacRunLoopRunInMode - run the event loop until timeout or stopped
*
*************************************************************************/
void MacRunLoopRunInMode(double timeInterval);
/****************************************************************************
*
* MacRunLoopStop - stop the Mac run loop
*
****************************************************************************/
void MacRunLoopStop();
void StopVM(JavaVM *vm);
int CreateJavaVM(JavaVM **pvm, void **pEnv, void *args);