author | Claus Gittinger <cg@exept.de> |
Wed, 29 Jan 1997 15:29:04 +0100 | |
changeset 2303 | f19df2d4c238 |
parent 2298 | e75dabb791dc |
child 2306 | 3851fc553893 |
permissions | -rw-r--r-- |
6 | 1 |
" |
2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
358 | 3 |
All Rights Reserved |
6 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
IdentityDictionary subclass:#WeakIdentityDictionary |
|
1054 | 14 |
instanceVariableNames:'' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Collections-Unordered' |
|
6 | 18 |
! |
19 |
||
10 | 20 |
!WeakIdentityDictionary class methodsFor:'documentation'! |
21 |
||
88 | 22 |
copyright |
23 |
" |
|
24 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
358 | 25 |
All Rights Reserved |
88 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
10 | 36 |
documentation |
37 |
" |
|
1263 | 38 |
WeakIdentityDictionaries behave like IdentityDictionaries, |
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
39 |
as long as the keys are still referenced by some |
1263 | 40 |
other (non-weak) object. |
41 |
However, once the last non-weak reference ceases to exist, |
|
42 |
the object will be automatically removed from the Weakcollection |
|
43 |
(with some delay: it will be removed after the next garbage collect). |
|
44 |
||
45 |
This class was added to support keeping track of dependents without |
|
88 | 46 |
keeping the values alive - values simply become nil when no one else |
47 |
references it. The original dependency mechanism used a regular Dictionary, |
|
48 |
which usually leads to a lot of garbage being kept due to a forgotten |
|
49 |
release. Using a WeakDictionary may be incompatible to ST-80 but is much |
|
50 |
more comfortable, since no manual release of dependents is needed. |
|
1263 | 51 |
|
2260 | 52 |
If you use this, be very careful since the collections size changes |
53 |
'magically' - for example, testing for being nonEmpty and then |
|
54 |
removing the first element may fail, since the element may vanish inbetween. |
|
55 |
In general, never trust the value as returned by the size/isEmpty messages. |
|
56 |
||
57 |
||
1290 | 58 |
[author:] |
59 |
Claus Gittinger |
|
60 |
||
1263 | 61 |
[See also:] |
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
62 |
WeakArray WeakValueDictionary WeakIdentitySet |
10 | 63 |
" |
64 |
! ! |
|
65 |
||
359 | 66 |
!WeakIdentityDictionary methodsFor:'adding & removing'! |
67 |
||
2298 | 68 |
at:key |
69 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
70 |
|val| |
2298 | 71 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
72 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
73 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
74 |
^ super at:key. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
75 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
76 |
|
2298 | 77 |
[ |
78 |
val := super at:key. |
|
79 |
] valueNowOrOnUnwindDo:[ |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
80 |
OperatingSystem unblockInterrupts. |
2298 | 81 |
]. |
82 |
^ val |
|
83 |
||
84 |
"Modified: 6.5.1996 / 12:22:26 / stefan" |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
85 |
"Modified: 29.1.1997 / 15:07:44 / cg" |
2298 | 86 |
! |
87 |
||
88 |
at:key ifAbsent:exceptionBlock |
|
89 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
90 |
|val| |
2298 | 91 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
92 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
93 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
94 |
^ super at:key ifAbsent:exceptionBlock. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
95 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
96 |
|
2298 | 97 |
[ |
98 |
val := super at:key ifAbsent:exceptionBlock. |
|
99 |
] valueNowOrOnUnwindDo:[ |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
100 |
OperatingSystem unblockInterrupts. |
2298 | 101 |
]. |
102 |
^ val |
|
103 |
||
104 |
"Modified: 6.5.1996 / 12:22:26 / stefan" |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
105 |
"Modified: 29.1.1997 / 15:08:07 / cg" |
2298 | 106 |
! |
107 |
||
1256 | 108 |
at:key put:anObject |
109 |
"add the argument anObject under key, aKey to the receiver. |
|
110 |
Return anObject (sigh). |
|
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
111 |
Redefined to block interrupts, to avoid trouble when dependencies |
1256 | 112 |
are added within interrupting high prio processes." |
113 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
114 |
|val| |
359 | 115 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
116 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
117 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
118 |
^ super at:key put:anObject. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
119 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
120 |
|
1790 | 121 |
[ |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
122 |
val := super at:key put:anObject. |
1790 | 123 |
] valueNowOrOnUnwindDo:[ |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
124 |
OperatingSystem unblockInterrupts. |
1790 | 125 |
]. |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
126 |
^ val |
1223 | 127 |
|
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
128 |
"Modified: 6.5.1996 / 12:22:26 / stefan" |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
129 |
"Modified: 29.1.1997 / 15:08:45 / cg" |
359 | 130 |
! |
131 |
||
132 |
removeKey:aKey ifAbsent:aBlock |
|
1256 | 133 |
"remove the association under aKey from the collection, |
134 |
return the value previously stored there.. |
|
135 |
If it was not in the collection return the result |
|
136 |
from evaluating aBlock. |
|
137 |
||
138 |
Redefined to avoid synchronization problems, in case |
|
139 |
of interrupts (otherwise, there could be some other operation |
|
140 |
on the receiver done by another process, which garbles my contents)." |
|
1054 | 141 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
142 |
|ret| |
359 | 143 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
144 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
145 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
146 |
^ super removeKey:aKey ifAbsent:aBlock. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
147 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
148 |
|
359 | 149 |
[ |
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
150 |
ret := super removeKey:aKey ifAbsent:aBlock |
359 | 151 |
] valueNowOrOnUnwindDo:[ |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
152 |
OperatingSystem unblockInterrupts |
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
153 |
]. |
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
154 |
^ ret |
1054 | 155 |
|
1343
b0ee705c63e0
Correct return value when removing elements.
Stefan Vogel <sv@exept.de>
parents:
1290
diff
changeset
|
156 |
"Modified: 6.5.1996 / 12:44:51 / stefan" |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
157 |
"Modified: 29.1.1997 / 15:09:11 / cg" |
359 | 158 |
! ! |
159 |
||
10 | 160 |
!WeakIdentityDictionary methodsFor:'element disposal'! |
161 |
||
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
162 |
update:something with:aParameter from:changedObject |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
163 |
"an element (either key or value) died - clear out slots for |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
164 |
disposed keys." |
6 | 165 |
|
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
166 |
|wasBlocked| |
358 | 167 |
|
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
168 |
something == #ElementExpired ifTrue:[ |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
169 |
" |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
170 |
have to block here - dispose may be done at a low priority |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
171 |
from the background finalizer. If new items are added by a |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
172 |
higher prio process, the dictionary might get corrupted otherwise |
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
173 |
" |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
174 |
wasBlocked := OperatingSystem blockInterrupts. |
10 | 175 |
|
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
176 |
keyArray |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
177 |
forAllDeadIndicesDo:[:idx | |
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
178 |
valueArray basicAt:idx put:nil. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
179 |
tally := tally - 1. |
2027
4a2cdf9946ae
replace items with DeletedEntry, when objects are collected.
ca
parents:
1790
diff
changeset
|
180 |
] |
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
181 |
replacingCorpsesWith:DeletedEntry. |
358 | 182 |
|
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
183 |
wasBlocked ifFalse:[OperatingSystem unblockInterrupts]. |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
184 |
] |
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
185 |
|
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
186 |
"Created: 7.1.1997 / 16:59:30 / stefan" |
6 | 187 |
! ! |
609 | 188 |
|
189 |
!WeakIdentityDictionary methodsFor:'private'! |
|
190 |
||
2298 | 191 |
grow:newSize |
192 |
"grow the receiver. |
|
193 |
Redefined to block interrupts, to avoid trouble when dependencies |
|
194 |
are added within interrupting high prio processes." |
|
195 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
196 |
"/ 'grow:' printCR. |
2298 | 197 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
198 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
199 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
200 |
^ super grow:newSize. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
201 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
202 |
|
2298 | 203 |
[ |
204 |
super grow:newSize |
|
205 |
] valueNowOrOnUnwindDo:[ |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
206 |
OperatingSystem unblockInterrupts |
2298 | 207 |
]. |
208 |
||
209 |
"Created: 28.1.1997 / 23:41:39 / cg" |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
210 |
"Modified: 29.1.1997 / 15:10:12 / cg" |
2298 | 211 |
! |
212 |
||
609 | 213 |
keyContainerOfSize:n |
214 |
"return a container for keys of size n. |
|
2298 | 215 |
use WeakArrays here, but dont make me a depenent of it." |
609 | 216 |
|
217 |
|w| |
|
218 |
||
219 |
w := WeakArray new:n. |
|
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
220 |
w addDependent:self. |
609 | 221 |
^ w |
2091
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
222 |
|
c11bb3e29a1b
Use dependent mechamism of WeakArray instead of #watcher.
Stefan Vogel <sv@exept.de>
parents:
2027
diff
changeset
|
223 |
"Modified: 7.1.1997 / 17:01:15 / stefan" |
2298 | 224 |
"Modified: 29.1.1997 / 14:18:49 / cg" |
225 |
! |
|
226 |
||
227 |
rehash |
|
228 |
"grow the receiver. |
|
229 |
Redefined to block interrupts, to avoid trouble when dependencies |
|
230 |
are added within interrupting high prio processes." |
|
231 |
||
232 |
"/ 'rehash' printCR. |
|
233 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
234 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
235 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
236 |
^ super rehash. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
237 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
238 |
|
2298 | 239 |
[ |
240 |
super rehash |
|
241 |
] valueNowOrOnUnwindDo:[ |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
242 |
OperatingSystem unblockInterrupts |
2298 | 243 |
]. |
244 |
||
245 |
"Created: 29.1.1997 / 11:39:42 / cg" |
|
246 |
"Modified: 29.1.1997 / 14:18:52 / cg" |
|
247 |
! |
|
248 |
||
249 |
setTally:count |
|
250 |
"grow the receiver. |
|
251 |
Redefined to block interrupts, to avoid trouble when dependencies |
|
252 |
are added within interrupting high prio processes." |
|
253 |
||
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
254 |
"/ 'setTally:' printCR. |
2298 | 255 |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
256 |
(OperatingSystem blockInterrupts) ifTrue:[ |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
257 |
"/ already blocked |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
258 |
^ super setTally:count. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
259 |
]. |
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
260 |
|
2298 | 261 |
[ |
262 |
super setTally:count |
|
263 |
] valueNowOrOnUnwindDo:[ |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
264 |
OperatingSystem unblockInterrupts |
2298 | 265 |
]. |
266 |
||
267 |
"Created: 29.1.1997 / 11:40:12 / cg" |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
268 |
"Modified: 29.1.1997 / 15:11:11 / cg" |
609 | 269 |
! ! |
270 |
||
635 | 271 |
!WeakIdentityDictionary class methodsFor:'documentation'! |
272 |
||
273 |
version |
|
2303
f19df2d4c238
avoid creation of a blocks if possible - if not, cheap ones are now created
Claus Gittinger <cg@exept.de>
parents:
2298
diff
changeset
|
274 |
^ '$Header: /cvs/stx/stx/libbasic/WeakIdentityDictionary.st,v 1.26 1997-01-29 14:28:36 cg Exp $' |
635 | 275 |
! ! |