author | hlopkmar |
Mon, 28 Nov 2011 13:03:05 +0000 | |
branch | jk_new_structure |
changeset 1169 | 8f727dc66647 |
parent 1159 | afe8ab363ca3 |
child 1172 | 7795b5618017 |
permissions | -rw-r--r-- |
1142 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
1142 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
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. |
|
15 |
||
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
1142 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
Object subclass:#JavaMonitor |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
24 |
instanceVariableNames:'owningProcess processesEntered monitorSema processesEnteredAccess |
1146 | 25 |
owningProcessAccess count countAccess waitingSema |
26 |
processesWaitingAccess processesWaiting' |
|
1142 | 27 |
classVariableNames:'' |
28 |
poolDictionaries:'' |
|
29 |
category:'Languages-Java-Support' |
|
30 |
! |
|
31 |
||
32 |
!JavaMonitor class methodsFor:'documentation'! |
|
33 |
||
34 |
copyright |
|
35 |
" |
|
36 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 37 |
|
1155 | 38 |
New code and modifications done at SWING Research Group [1]: |
1152 | 39 |
|
1142 | 40 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
41 |
SWING Research Group, Czech Technical University in Prague |
|
42 |
||
43 |
This software is furnished under a license and may be used |
|
44 |
only in accordance with the terms of that license and with the |
|
45 |
inclusion of the above copyright notice. This software may not |
|
46 |
be provided or otherwise made available to, or used by, any |
|
47 |
other person. No title to or ownership of the software is |
|
48 |
hereby transferred. |
|
49 |
||
1155 | 50 |
[1] Code written at SWING Research Group contains a signature |
51 |
of one of the above copright owners. For exact set of such code, |
|
52 |
see the differences between this version and version stx:libjava |
|
1152 | 53 |
as of 1.9.2010 |
1142 | 54 |
|
55 |
" |
|
56 |
! ! |
|
57 |
||
58 |
!JavaMonitor class methodsFor:'instance creation'! |
|
59 |
||
60 |
new |
|
61 |
^self basicNew initialize. |
|
62 |
||
63 |
"Created: / 20-11-2011 / 14:30:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
64 |
! ! |
|
65 |
||
66 |
!JavaMonitor methodsFor:'accessing'! |
|
67 |
||
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
68 |
activeProcess |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
69 |
^ Processor activeProcess |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
70 |
! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
71 |
|
1142 | 72 |
copyProcessesEntered |
73 |
^ processesEntered copy. |
|
74 |
||
75 |
"Created: / 20-11-2011 / 14:45:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
76 |
! |
|
77 |
||
78 |
processesEntered |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
79 |
"dont do anything to me, access needs to be sync'd" |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
80 |
^ processesEntered. |
1142 | 81 |
|
82 |
"Created: / 20-11-2011 / 13:22:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
83 |
! ! |
|
84 |
||
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
85 |
!JavaMonitor methodsFor:'atomic'! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
86 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
87 |
addProcess: aProcess |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
88 |
processesEnteredAccess critical: [processesEntered add: aProcess]. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
89 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
90 |
"Created: / 20-11-2011 / 20:30:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
91 |
! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
92 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
93 |
clearOwningProcess |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
94 |
owningProcessAccess critical: [ owningProcess := nil ]. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
95 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
96 |
"Created: / 20-11-2011 / 20:34:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
97 |
! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
98 |
|
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
99 |
decrement |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
100 |
"owning process released monitor, lets lower our counter so we know how many times |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
101 |
do we have to release it" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
102 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
103 |
countAccess critical: [ count := count - 1 ]. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
104 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
105 |
"Created: / 22-11-2011 / 10:49:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
106 |
! |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
107 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
108 |
increment |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
109 |
"owning process entered monitor again (recursion ...), lets raise our counter so we know how many times |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
110 |
do we have to release it" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
111 |
countAccess critical: [ count := count + 1 ]. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
112 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
113 |
"Created: / 22-11-2011 / 10:49:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
114 |
! |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
115 |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
116 |
owningProcess: aProcess |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
117 |
owningProcessAccess critical: [owningProcess := aProcess]. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
118 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
119 |
"Created: / 20-11-2011 / 20:32:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
120 |
! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
121 |
|
1146 | 122 |
processesWaitingAdd: aProcess |
123 |
processesWaitingAccess |
|
124 |
critical: [ self assert: (processesWaiting includesKey: aProcess) not.processesWaiting at: aProcess put: count ]. |
|
125 |
||
126 |
"Created: / 22-11-2011 / 11:57:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
127 |
! |
|
128 |
||
129 |
processesWaitingRestore: aProcess |
|
130 |
processesWaitingAccess |
|
131 |
critical: [ |
|
132 |
self assert: (processesWaiting includesKey: aProcess). |
|
133 |
self reinitCounter: (processesWaiting at: aProcess). |
|
134 |
processesWaiting removeKey: aProcess |
|
135 |
]. |
|
136 |
||
137 |
"Created: / 22-11-2011 / 12:59:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
138 |
! |
|
139 |
||
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
140 |
reinitCounter |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
141 |
"owning process is different from previous, lets start counting from beginning" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
142 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
143 |
countAccess critical: [ count := 1 ]. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
144 |
|
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
145 |
"Created: / 22-11-2011 / 10:51:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
146 |
! |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
147 |
|
1146 | 148 |
reinitCounter: newCount |
149 |
countAccess critical: [ count := newCount ]. |
|
150 |
||
151 |
"Created: / 22-11-2011 / 13:00:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
152 |
! |
|
153 |
||
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
154 |
removeProcess: aProcess |
1146 | 155 |
processesEnteredAccess |
156 |
critical: [ |
|
157 |
self assert: processesEntered last == aProcess. |
|
158 |
processesEntered remove: aProcess |
|
159 |
]. |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
160 |
|
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
161 |
"Created: / 20-11-2011 / 20:28:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
162 |
! ! |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
163 |
|
1142 | 164 |
!JavaMonitor methodsFor:'initialization'! |
165 |
||
166 |
initialize |
|
167 |
owningProcess := nil. |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
168 |
owningProcessAccess := Semaphore forMutualExclusion. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
169 |
processesEntered := OrderedCollection new. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
170 |
processesEnteredAccess := Semaphore forMutualExclusion. |
1142 | 171 |
monitorSema := Semaphore new: 1. |
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
172 |
countAccess := Semaphore forMutualExclusion. |
1146 | 173 |
processesWaiting := Dictionary new. |
174 |
processesWaitingAccess := Semaphore forMutualExclusion. |
|
175 |
waitingSema := Semaphore new: 0. |
|
1142 | 176 |
|
177 |
"Created: / 20-11-2011 / 13:28:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
178 |
! ! |
|
179 |
||
180 |
!JavaMonitor methodsFor:'public'! |
|
181 |
||
182 |
acquire |
|
183 |
| thisProcess | |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
184 |
thisProcess := self activeProcess. |
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
185 |
(self isOwnedBy: thisProcess) ifTrue: [ |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
186 |
self increment. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
187 |
^ self |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
188 |
]. |
1142 | 189 |
monitorSema wait. |
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
190 |
self owningProcess: thisProcess. |
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
191 |
self reinitCounter. |
1142 | 192 |
|
193 |
"Created: / 20-11-2011 / 13:21:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
194 |
! |
|
195 |
||
196 |
enter |
|
197 |
| thisProcess | |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
198 |
thisProcess := self activeProcess. |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
199 |
self addProcess: thisProcess. |
1142 | 200 |
self acquire. |
201 |
||
202 |
"Created: / 20-11-2011 / 13:21:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
203 |
! |
|
204 |
||
205 |
exit |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
206 |
| thisProcess | |
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
207 |
thisProcess := self activeProcess. |
1169 | 208 |
(self isOwnedBy: thisProcess) ifTrue: [ self release. ]. |
209 |
processesEntered remove: thisProcess ifAbsent: nil. |
|
1142 | 210 |
|
211 |
"Created: / 20-11-2011 / 13:21:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
212 |
! |
|
213 |
||
1146 | 214 |
notify |
215 |
"wakeup one waiting process" |
|
216 |
||
217 |
| thisProcess | |
|
218 |
thisProcess := Processor activeProcess. |
|
219 |
self assert: (self isOwnedBy: thisProcess). |
|
220 |
waitingSema signal. |
|
221 |
||
222 |
"Created: / 22-11-2011 / 12:14:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
223 |
! |
|
224 |
||
225 |
notifyAll |
|
226 |
"wakeup one waiting process" |
|
227 |
||
228 |
| thisProcess | |
|
229 |
thisProcess := Processor activeProcess. |
|
230 |
self assert: (self isOwnedBy: thisProcess). |
|
231 |
waitingSema signalForAll. |
|
232 |
||
233 |
"Created: / 22-11-2011 / 12:14:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
234 |
! |
|
235 |
||
1142 | 236 |
release |
237 |
| thisProcess | |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
238 |
thisProcess := self activeProcess. |
1145
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
239 |
self assert: (self isOwnedBy: owningProcess). |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
240 |
count == 1 ifTrue: [ |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
241 |
self clearOwningProcess. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
242 |
monitorSema signal. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
243 |
] ifFalse: [ |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
244 |
self decrement. |
8728f5373a48
end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents:
1144
diff
changeset
|
245 |
] |
1142 | 246 |
|
247 |
"Created: / 20-11-2011 / 13:21:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1146 | 248 |
! |
249 |
||
250 |
releaseAll |
|
251 |
count timesRepeat: [self release]. |
|
252 |
||
253 |
"Created: / 22-11-2011 / 13:05:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
254 |
! |
|
255 |
||
256 |
wait |
|
257 |
"make owning process to go to wait" |
|
258 |
||
259 |
self waitForMilliseconds: nil. |
|
260 |
||
261 |
"Created: / 22-11-2011 / 11:57:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
262 |
! |
|
263 |
||
264 |
waitForMilliseconds: timeOut |
|
265 |
"make owning process to go to wait, but not longer than timeout" |
|
266 |
||
267 |
| thisProcess | |
|
268 |
thisProcess := Processor activeProcess. |
|
269 |
self assert: (self isOwnedBy: thisProcess). |
|
270 |
self processesWaitingAdd: thisProcess. |
|
271 |
self releaseAll. |
|
1169 | 272 |
"JV@2011-11-25: zero timeout means wait without timeout!!!!!!" |
273 |
timeOut == 0 ifTrue: [ waitingSema wait ] ifFalse: [ |
|
1159 | 274 |
waitingSema waitWithTimeoutMs: timeOut |
275 |
]. |
|
1146 | 276 |
self acquire. |
277 |
self processesWaitingRestore: thisProcess. |
|
278 |
||
279 |
"Created: / 22-11-2011 / 12:52:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1159 | 280 |
"Modified (comment): / 25-11-2011 / 18:30:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1169 | 281 |
"Modified: / 28-11-2011 / 14:01:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1142 | 282 |
! ! |
283 |
||
284 |
!JavaMonitor methodsFor:'queries'! |
|
285 |
||
286 |
isAcquired |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
287 |
^ owningProcessAccess critical: [owningProcess notNil]. |
1142 | 288 |
|
289 |
"Created: / 20-11-2011 / 13:22:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
290 |
! |
|
291 |
||
292 |
isOwnedBy: aProcess |
|
1143
5e1de8c6b43e
JavaMonitor more or less finished.. integration coming soon
hlopkmar
parents:
1142
diff
changeset
|
293 |
^ owningProcessAccess critical: [ owningProcess == aProcess ]. |
1142 | 294 |
|
295 |
"Created: / 20-11-2011 / 13:23:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
296 |
! ! |
|
297 |
||
298 |
!JavaMonitor class methodsFor:'documentation'! |
|
299 |
||
300 |
version_SVN |
|
301 |
^ '$Id$' |
|
302 |
! ! |