author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 11 Jun 2019 22:03:11 +0100 | |
changeset 3914 | 35aa88fa58c1 |
parent 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 |
|
3782
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
131 |
| jThread jThreadMonitor | |
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:[ |
3782
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
134 |
jThreadMonitor := jThread getJavaMonitor. |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
135 |
[ |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
136 |
jThreadMonitor |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
137 |
acquire; |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
138 |
notify: true. "/ notifyAll() |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
139 |
] ensure:[ |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
140 |
jThreadMonitor release. |
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
141 |
]. |
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
|
142 |
]. |
2151 | 143 |
super terminateNoSignal |
144 |
||
145 |
"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
|
146 |
"Modified: / 09-12-2011 / 12:51:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
3782
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
147 |
"Modified: / 15-08-2017 / 23:39:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 148 |
! ! |
149 |
||
150 |
!JavaProcess::Helper methodsFor:'initialization'! |
|
151 |
||
152 |
javaProcess:something |
|
153 |
javaProcess := something. |
|
154 |
! |
|
155 |
||
156 |
javaThreadObject:something |
|
157 |
javaThreadObject := something. |
|
158 |
! ! |
|
159 |
||
160 |
!JavaProcess::Helper methodsFor:'support'! |
|
161 |
||
162 |
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
|
163 |
| procName | |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
164 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
165 |
AbortOperationRequest handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
166 |
procName := javaProcess name. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
167 |
(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
|
168 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
169 |
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
|
170 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
171 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
172 |
ex restart. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
173 |
] ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
174 |
(javaProcess == (Smalltalk at:#'JavaVM:JavaScreenUpdaterThread') |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
175 |
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
|
176 |
ifTrue:[ |
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 - 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
|
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 |
ex restart |
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 |
ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
184 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
185 |
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
|
186 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
187 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
188 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
189 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
190 |
] do: [ |
2151 | 191 |
[ |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
192 |
JavaVM javaExceptionSignal handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
193 |
| exClass | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
194 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
195 |
procName := javaProcess name. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
196 |
exClass := ex parameter class. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
197 |
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
|
198 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
199 |
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
|
200 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
201 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
202 |
] ifFalse:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
203 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
204 |
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
|
205 |
, 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
|
206 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
207 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
208 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
209 |
ex return. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
210 |
] do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
211 |
MessageNotUnderstood handle:[:ex | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
212 |
| |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
213 |
"/ 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
|
214 |
"/ a nullPointerException ... |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
215 |
con m | |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
216 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
217 |
con := ex suspendedContext. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
218 |
con receiver isNil ifTrue:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
219 |
((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
|
220 |
JavaVM throwNullPointerException. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
221 |
AbortSignal raise. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
222 |
|
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
223 |
"/ ex proceed. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
224 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
225 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
226 |
ex reject. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
227 |
] |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
228 |
do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
229 |
"/ 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
|
230 |
[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
231 |
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
|
232 |
JavaUnhandledThreadDeathError handle:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
233 |
"/ 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
|
234 |
] do:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
235 |
javaThreadObject perform:#'run()V'. |
2151 | 236 |
]. |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
237 |
(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
|
238 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
239 |
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
|
240 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
241 |
facility:'JVM'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
242 |
]. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
243 |
] ensure:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
244 |
javaThreadObject perform:#'exit()V'. |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
245 |
(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
|
246 |
Logger |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
247 |
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
|
248 |
severity:Logger severityDEBUG |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
249 |
facility:'JVM'. |
2151 | 250 |
] |
251 |
] |
|
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
252 |
] |
2151 | 253 |
] |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
254 |
] ensure:[ |
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
255 |
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
|
256 |
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
|
257 |
]. |
3121
cc0ea0656186
Fixed bug #77: Ignore unhandled ThreadDeath exceptions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
258 |
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
|
259 |
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
|
260 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2200
diff
changeset
|
261 |
|
2151 | 262 |
"/ screenUpdaterClass := Java at:'sun.awt.ScreenUpdater'. |
263 |
"/ screenUpdaterClass notNil ifTrue:[ |
|
264 |
"/ screenUpdaterClass instVarNamed:'updater' put:nil. |
|
265 |
"/ ]. |
|
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
|
266 |
|
2151 | 267 |
] |
268 |
] |
|
269 |
||
270 |
"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
|
271 |
"Modified: / 09-12-2011 / 12:51:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
3782
32e335ed7c6f
Issue #94 [9/x]: removed great deal of unused monitor-handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3431
diff
changeset
|
272 |
"Modified: / 15-08-2017 / 23:44:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 273 |
! ! |
274 |
||
133 | 275 |
!JavaProcess class methodsFor:'documentation'! |
56 | 276 |
|
277 |
version |
|
3431
82790b1e6d54
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3430
diff
changeset
|
278 |
^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.24 2015-03-20 12:08:00 vrany Exp $' |
2200 | 279 |
! |
280 |
||
281 |
version_CVS |
|
3431
82790b1e6d54
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3430
diff
changeset
|
282 |
^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.24 2015-03-20 12:08:00 vrany Exp $' |
2151 | 283 |
! |
284 |
||
285 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
286 |
^ 'Id' |
2107 | 287 |
! ! |
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
|
288 |