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