author | Claus Gittinger <cg@exept.de> |
Mon, 30 Dec 2019 19:40:02 +0100 | |
branch | cvs_MAIN |
changeset 3993 | 7d6d72ea6cf1 |
parent 3431 | 82790b1e6d54 |
child 3782 | 32e335ed7c6f |
permissions | -rw-r--r-- |
454 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3214
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3214
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
454 | 8 |
|
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
2151 | 15 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
713 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
23 |
"{ NameSpace: Smalltalk }" |
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
24 |
|
56 | 25 |
Process subclass:#JavaProcess |
26 |
instanceVariableNames:'suspendedContext' |
|
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
713 | 29 |
category:'Languages-Java-Classes' |
56 | 30 |
! |
31 |
||
2151 | 32 |
Object subclass:#Helper |
33 |
instanceVariableNames:'javaThreadObject javaProcess' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:JavaProcess |
|
37 |
! |
|
38 |
||
454 | 39 |
!JavaProcess class methodsFor:'documentation'! |
40 |
||
41 |
copyright |
|
42 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3214
diff
changeset
|
43 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
44 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
45 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
46 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3214
diff
changeset
|
47 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
48 |
SWING Research Group, Czech Technical University in Prague |
454 | 49 |
|
50 |
This software is furnished under a license and may be used |
|
51 |
only in accordance with the terms of that license and with the |
|
52 |
inclusion of the above copyright notice. This software may not |
|
53 |
be provided or otherwise made available to, or used by, any |
|
54 |
other person. No title to or ownership of the software is |
|
55 |
hereby transferred. |
|
2151 | 56 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
57 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
58 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
59 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
60 |
as of 1.9.2010 |
2151 | 61 |
|
2107 | 62 |
" |
2151 | 63 |
! ! |
749 | 64 |
|
2151 | 65 |
!JavaProcess class methodsFor:'instance creation'! |
66 |
||
67 |
newHelper |
|
68 |
||
69 |
^Helper new |
|
70 |
||
71 |
"Created: / 15-12-2010 / 11:11:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
454 | 72 |
! ! |
56 | 73 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
74 |
!JavaProcess class methodsFor:'others'! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
75 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
76 |
version_HG |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
77 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
78 |
^ '$Changeset: <not expanded> $' |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
79 |
! ! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2559
diff
changeset
|
80 |
|
58 | 81 |
!JavaProcess methodsFor:'accessing'! |
82 |
||
83 |
suspendedContext |
|
261 | 84 |
|con| |
85 |
||
313 | 86 |
"/ suspendedContext notNil ifTrue:[^ suspendedContext]. |
87 |
"/ state ~~ #debug ifTrue:[ |
|
88 |
"/ "/ hide non-JAVA contexts ... |
|
89 |
"/ con := super suspendedContext. |
|
90 |
"/ [con notNil] whileTrue:[ |
|
91 |
"/ (con isMemberOf:JavaContext) ifTrue:[^ con]. |
|
92 |
"/ con := con sender. |
|
93 |
"/ ]. |
|
94 |
"/ ]. |
|
261 | 95 |
^ super suspendedContext |
58 | 96 |
|
261 | 97 |
"Created: / 7.5.1996 / 09:02:03 / cg" |
313 | 98 |
"Modified: / 4.2.1998 / 20:44:31 / cg" |
58 | 99 |
! |
100 |
||
101 |
suspendedContext:aContext |
|
102 |
suspendedContext := aContext |
|
103 |
||
104 |
"Created: 7.5.1996 / 09:02:12 / cg" |
|
105 |
! ! |
|
106 |
||
221 | 107 |
!JavaProcess methodsFor:'interrupts'! |
108 |
||
109 |
clearInterruptActions |
|
110 |
interruptActions := nil |
|
111 |
||
112 |
"Created: 14.8.1997 / 17:27:22 / cg" |
|
113 |
! |
|
114 |
||
115 |
isInterrupted |
|
116 |
^ interruptActions notNil |
|
117 |
||
118 |
"Created: 14.8.1997 / 17:26:40 / cg" |
|
338 | 119 |
! |
120 |
||
121 |
markInterrupted |
|
122 |
super interruptWith:[] |
|
123 |
||
124 |
"Modified: / 10.4.1998 / 15:20:58 / cg" |
|
125 |
"Created: / 10.4.1998 / 15:21:15 / cg" |
|
221 | 126 |
! ! |
127 |
||
2151 | 128 |
!JavaProcess methodsFor:'suspend & resume'! |
129 |
||
130 |
terminateNoSignal |
|
131 |
| jThread | |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
132 |
jThread := Java threadForStProcess: self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
133 |
jThread notNil ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
134 |
JavaVM acquireMonitorAndNotifyAll: jThread. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
135 |
]. |
2151 | 136 |
super terminateNoSignal |
137 |
||
138 |
"Created: / 15-12-2010 / 00:18:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
139 |
"Modified: / 09-12-2011 / 12:51:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
140 |
"Modified: / 27-08-2012 / 11:50:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 141 |
! ! |
142 |
||
143 |
!JavaProcess::Helper methodsFor:'initialization'! |
|
144 |
||
145 |
javaProcess:something |
|
146 |
javaProcess := something. |
|
147 |
! |
|
148 |
||
149 |
javaThreadObject:something |
|
150 |
javaThreadObject := something. |
|
151 |
! ! |
|
152 |
||
153 |
!JavaProcess::Helper methodsFor:'support'! |
|
154 |
||
155 |
value |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
156 |
| procName | |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
157 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
158 |
AbortOperationRequest handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
159 |
procName := javaProcess name. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
160 |
(procName startsWith:'JAVA-AWT-EventQueue') ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
161 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
162 |
log:('thread ' , procName , ' aborted - restarting process.') |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
163 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
164 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
165 |
ex restart. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
166 |
] ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
167 |
(javaProcess == (Smalltalk at:#'JavaVM:JavaScreenUpdaterThread') |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
168 |
or:[ javaProcess == (Smalltalk at:#'JavaVM:JavaEventQueueThread') ]) |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
169 |
ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
170 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
171 |
log:('thread ' , procName , ' aborted - restarting process.') |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
172 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
173 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
174 |
ex restart |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
175 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
176 |
ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
177 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
178 |
log:('thread ' , procName , ' aborted.') |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
179 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
180 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
181 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
182 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
183 |
] do: [ |
2151 | 184 |
[ |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
185 |
JavaVM javaExceptionSignal handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
186 |
| exClass | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
187 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
188 |
procName := javaProcess name. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
189 |
exClass := ex parameter class. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
190 |
exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
191 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
192 |
log:('thread ' , procName , ' terminated') |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
193 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
194 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
195 |
] ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
196 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
197 |
log:('JAVA: thread ''' , procName , ''' terminated with exception: ' |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
198 |
, exClass name) |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
199 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
200 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
201 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
202 |
ex return. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
203 |
] do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
204 |
MessageNotUnderstood handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
205 |
| |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
206 |
"/ remap doesNotUnderstand with nil-receiver to |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
207 |
"/ a nullPointerException ... |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
208 |
con m | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
209 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
210 |
con := ex suspendedContext. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
211 |
con receiver isNil ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
212 |
((m := con sender method) notNil and:[ m isJavaMethod ]) ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
213 |
JavaVM throwNullPointerException. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
214 |
AbortSignal raise. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
215 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
216 |
"/ ex proceed. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
217 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
218 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
219 |
ex reject. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
220 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
221 |
do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
222 |
"/ Transcript showCR:(Timestamp now printString , 'start thread: ', stProcess name). |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
223 |
[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
224 |
javaThreadObject instVarNamed:'tid' put:javaProcess id. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
225 |
JavaUnhandledThreadDeathError handle:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
226 |
"/ Ignore unhandled ThreadDeath, see Thread#stop() |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
227 |
] do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
228 |
javaThreadObject perform:#'run()V'. |
2151 | 229 |
]. |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
230 |
(Smalltalk at:#'JavaVM:ThreadTrace') == true ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
231 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
232 |
log:('thread ' , javaProcess name , ' terminated') |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
233 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
234 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
235 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
236 |
] ensure:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
237 |
javaThreadObject perform:#'exit()V'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
238 |
(Smalltalk at:#'JavaVM:ThreadTrace') == true ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
239 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
240 |
log:('after exit of thread ' , javaProcess name) |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
241 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
242 |
facility:'JVM'. |
2151 | 243 |
] |
244 |
] |
|
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
245 |
] |
2151 | 246 |
] |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
247 |
] ensure:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
248 |
JavaVM leaveMonitorsOfProcess:javaProcess. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
249 |
javaProcess == (Smalltalk at:#'JavaVM:JavaScreenUpdaterThread') ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
250 |
Smalltalk at:#'JavaVM:JavaScreenUpdaterThread' put:nil. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
251 |
]. |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
252 |
javaProcess == (Smalltalk at:#'JavaVM:JavaEventQueueThread') ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
253 |
Smalltalk at:#'JavaVM:JavaEventQueueThread' put:nil. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
254 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
255 |
|
2151 | 256 |
"/ screenUpdaterClass := Java at:'sun.awt.ScreenUpdater'. |
257 |
"/ screenUpdaterClass notNil ifTrue:[ |
|
258 |
"/ screenUpdaterClass instVarNamed:'updater' put:nil. |
|
259 |
"/ ]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
260 |
|
2151 | 261 |
] |
262 |
] |
|
263 |
||
264 |
"Created: / 15-12-2010 / 11:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
265 |
"Modified: / 09-12-2011 / 12:51:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
3384
98eb8443f4f4
Use new Logger API (use Logger severityXXX instead of symbols)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
266 |
"Modified: / 02-03-2015 / 14:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 267 |
! ! |
268 |
||
133 | 269 |
!JavaProcess class methodsFor:'documentation'! |
56 | 270 |
|
271 |
version |
|
3431
82790b1e6d54
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3430
diff
changeset
|
272 |
^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.24 2015-03-20 12:08:00 vrany Exp $' |
2200 | 273 |
! |
274 |
||
275 |
version_CVS |
|
3431
82790b1e6d54
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3430
diff
changeset
|
276 |
^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.24 2015-03-20 12:08:00 vrany Exp $' |
2151 | 277 |
! |
278 |
||
279 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
280 |
^ 'Id' |
2107 | 281 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
282 |