author | coleenp |
Wed, 05 Apr 2017 01:11:25 +0000 | |
changeset 46363 | b53de34a044c |
parent 42633 | 0c23e9d8fccf |
permissions | -rw-r--r-- |
34247
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
1 |
/* |
42633
0c23e9d8fccf
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
34247
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
34247
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
4 |
* |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
8 |
* |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
13 |
* accompanied this code). |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
14 |
* |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
18 |
* |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
21 |
* questions. |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
22 |
*/ |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
23 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
24 |
#define _POSIX_PTHREAD_SEMANTICS // to enable POSIX semantics for certain common APIs |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
25 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
26 |
#include <jni.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
27 |
#include <dlfcn.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
28 |
#include <limits.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
29 |
#include <pthread.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
30 |
#include <signal.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
31 |
#include <errno.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
32 |
#include <stdio.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
33 |
#include <string.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
34 |
#include <stdlib.h> |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
35 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
36 |
void *handle; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
37 |
char *error; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
38 |
char path[PATH_MAX]; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
39 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
40 |
jint(JNICALL *jni_create_java_vm)(JavaVM **, JNIEnv **, void *) = NULL; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
41 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
42 |
JavaVM *jvm; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
43 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
44 |
// method to perform dlclose on an open dynamic library handle |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
45 |
void closeHandle() { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
46 |
dlclose(handle); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
47 |
if ((error = dlerror()) != NULL) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
48 |
fputs("Error occurred while closing handle\n", stderr); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
49 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
50 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
51 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
52 |
// method to exit with a fail status |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
53 |
void fail() { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
54 |
if (handle) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
55 |
closeHandle(); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
56 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
57 |
exit(1); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
58 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
59 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
60 |
// method to handle occurred error and fail |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
61 |
void handleError(char *messageTitle, char *messageBody) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
62 |
fprintf(stderr, "%s: %s\n", messageTitle, messageBody); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
63 |
fail(); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
64 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
65 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
66 |
// method to load the dynamic library libjvm |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
67 |
void loadJVM() { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
68 |
char lib[PATH_MAX]; |
42633
0c23e9d8fccf
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
34247
diff
changeset
|
69 |
snprintf(lib, sizeof (lib), "%s/lib/server/libjvm.so", path); |
34247
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
70 |
handle = dlopen(lib, RTLD_LAZY); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
71 |
if (!handle) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
72 |
handleError(dlerror(), "2"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
73 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
74 |
fputs("Will load JVM...\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
75 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
76 |
// find the address of function |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
77 |
*(void **) (&jni_create_java_vm) = dlsym(handle, "JNI_CreateJavaVM"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
78 |
if ((error = dlerror()) != NULL) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
79 |
handleError(error, "3"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
80 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
81 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
82 |
fputs("JVM loaded okay.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
83 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
84 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
85 |
// method to get created jvm environment |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
86 |
JNIEnv* initJVM() { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
87 |
JNIEnv *env = NULL; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
88 |
JavaVMInitArgs vm_args; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
89 |
JavaVMOption options[1]; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
90 |
jint res; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
91 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
92 |
options[0].optionString = "-Xrs"; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
93 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
94 |
vm_args.version = JNI_VERSION_1_2; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
95 |
vm_args.nOptions = 1; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
96 |
vm_args.options = options; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
97 |
vm_args.ignoreUnrecognized = JNI_FALSE; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
98 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
99 |
fputs("Will create JVM...\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
100 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
101 |
res = (*jni_create_java_vm)(&jvm, &env, &vm_args); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
102 |
if (res < 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
103 |
handleError("Can't create Java VM", strerror(res)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
104 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
105 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
106 |
fputs("JVM created OK!\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
107 |
return env; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
108 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
109 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
110 |
// method to invoke java method from java class |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
111 |
void callJava(JNIEnv *env) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
112 |
jclass cls; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
113 |
jmethodID mid; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
114 |
jstring jstr; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
115 |
jobjectArray args; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
116 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
117 |
cls = (*env)->FindClass(env, "Prog"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
118 |
if (cls == 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
119 |
handleError("FindClass", "Can't find Prog class"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
120 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
121 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
122 |
mid = (*env)->GetStaticMethodID(env, cls, "main", "([Ljava/lang/String;)V"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
123 |
if (mid == 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
124 |
handleError("GetStaticMethodID", "Can't find Prog.main"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
125 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
126 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
127 |
jstr = (*env)->NewStringUTF(env, "from C!"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
128 |
if (jstr == 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
129 |
handleError("NewStringUTF", "Out of memory"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
130 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
131 |
args = (*env)->NewObjectArray(env, 1, |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
132 |
(*env)->FindClass(env, "java/lang/String"), jstr); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
133 |
if (args == 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
134 |
handleError("NewObjectArray", "Out of memory"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
135 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
136 |
(*env)->CallStaticVoidMethod(env, cls, mid, args); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
137 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
138 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
139 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
140 |
// method to load, init jvm and then invoke java method |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
141 |
void* loadAndCallJava(void* x) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
142 |
JNIEnv *env; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
143 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
144 |
fputs("Some thread will create JVM.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
145 |
loadJVM(); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
146 |
env = initJVM(); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
147 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
148 |
fputs("Some thread will call Java.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
149 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
150 |
callJava(env); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
151 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
152 |
if ((*jvm)->DetachCurrentThread(jvm) != 0) |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
153 |
fputs("Error: thread not detached!\n", stderr); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
154 |
fputs("Some thread exiting.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
155 |
return env; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
156 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
157 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
158 |
int main(int argc, char **argv) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
159 |
JNIEnv *env; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
160 |
sigset_t set; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
161 |
pthread_t thr1; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
162 |
pthread_attr_t attr; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
163 |
size_t ss = 0; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
164 |
int sig; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
165 |
int rc; // return code for pthread_* methods |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
166 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
167 |
// verify input |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
168 |
if (argc != 2) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
169 |
handleError("usage", "a.out jdk_path"); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
170 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
171 |
// copy input jdk path into a char buffer |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
172 |
strncpy(path, argv[1], PATH_MAX); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
173 |
// add null termination character |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
174 |
path[PATH_MAX - 1] = '\0'; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
175 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
176 |
fputs("Main thread will set signal mask.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
177 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
178 |
// initialize the signal set |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
179 |
sigemptyset(&set); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
180 |
// add a number of signals to a signal set |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
181 |
sigaddset(&set, SIGPIPE); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
182 |
sigaddset(&set, SIGTERM); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
183 |
sigaddset(&set, SIGHUP); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
184 |
sigaddset(&set, SIGINT); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
185 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
186 |
// examine and change mask of blocked signal |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
187 |
if ((rc = pthread_sigmask(SIG_BLOCK, &set, NULL))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
188 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
189 |
handleError("main: pthread_sigmask() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
190 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
191 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
192 |
// initializes the thread attributes object with default attribute values |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
193 |
if ((rc = pthread_attr_init(&attr))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
194 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
195 |
handleError("main: pthread_attr_init() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
196 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
197 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
198 |
ss = 1024 * 1024; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
199 |
// set the stack size attribute of the thread attributes object |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
200 |
if ((rc = pthread_attr_setstacksize(&attr, ss))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
201 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
202 |
handleError("main: pthread_attr_setstacksize() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
203 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
204 |
// get the stack size attribute of the thread attributes object |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
205 |
if ((rc = pthread_attr_getstacksize(&attr, &ss))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
206 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
207 |
handleError("main: pthread_attr_getstacksize() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
208 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
209 |
fprintf(stderr, "Stack size: %zu\n", ss); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
210 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
211 |
// start a new thread in the calling process, |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
212 |
// loadAndCallJava logic is passed as a start_routine argument |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
213 |
if ((rc = pthread_create(&thr1, NULL, loadAndCallJava, NULL))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
214 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
215 |
handleError("main: pthread_create() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
216 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
217 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
218 |
// initialize the signal set |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
219 |
sigemptyset(&set); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
220 |
// add a number of signals to a signal set |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
221 |
sigaddset(&set, SIGTERM); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
222 |
sigaddset(&set, SIGHUP); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
223 |
sigaddset(&set, SIGINT); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
224 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
225 |
fputs("Main thread waiting for signal.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
226 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
227 |
do { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
228 |
int err; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
229 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
230 |
sig = 0; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
231 |
err = sigwait(&set, &sig); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
232 |
if (err != 0) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
233 |
// print error message if unexpected signal occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
234 |
fprintf(stderr, "main: sigwait() error: %s\n", strerror(err)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
235 |
} else { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
236 |
// print success message and exit if expected signal occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
237 |
// this branch generally acts when JVM executes destroy() |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
238 |
fprintf(stdout, "main: sigwait() got: %d\nSucceed!\n", sig); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
239 |
exit(0); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
240 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
241 |
} while (sig != SIGTERM && sig != SIGINT); // exit the loop condition |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
242 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
243 |
// join with a terminated thread |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
244 |
if ((rc = pthread_join(thr1, NULL))) { |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
245 |
// handle error if occurred |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
246 |
handleError("main: pthread_join() error", strerror(rc)); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
247 |
} |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
248 |
|
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
249 |
// close an open dynamic library handle |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
250 |
closeHandle(); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
251 |
fputs("Main thread exiting.\n", stdout); |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
252 |
return 0; |
f91af85bcb5f
8133416: [TESTBUG] Remove @ignore for closed/runtime/4345157/Prog.java
stsmirno
parents:
diff
changeset
|
253 |
} |