equal
deleted
inserted
replaced
7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
|
13 "{ Package: 'stx:libbasic' }" |
12 "{ Package: 'stx:libbasic' }" |
14 |
13 |
15 Object subclass:#Delay |
14 Object subclass:#Delay |
16 instanceVariableNames:'millisecondDelta resumptionTime delaySemaphore' |
15 instanceVariableNames:'millisecondDelta resumptionTime delaySemaphore' |
17 classVariableNames:'' |
16 classVariableNames:'' |
182 ^ self new resumptionTime:aMillisecondTime |
181 ^ self new resumptionTime:aMillisecondTime |
183 |
182 |
184 "Modified: 18.4.1997 / 11:57:53 / stefan" |
183 "Modified: 18.4.1997 / 11:57:53 / stefan" |
185 ! ! |
184 ! ! |
186 |
185 |
|
186 |
187 !Delay class methodsFor:'queries'! |
187 !Delay class methodsFor:'queries'! |
188 |
188 |
189 millisecondClockValue |
189 millisecondClockValue |
190 "for ST-80 compatibility" |
190 "for ST-80 compatibility" |
191 |
191 |
220 ! ! |
220 ! ! |
221 |
221 |
222 !Delay methodsFor:'accessing'! |
222 !Delay methodsFor:'accessing'! |
223 |
223 |
224 delay:numberOfMillis |
224 delay:numberOfMillis |
225 "set the millisecond delta" |
225 "set the millisecond delta and create a new semapjore internally to wait upon" |
226 |
226 |
227 millisecondDelta := numberOfMillis. |
227 millisecondDelta := numberOfMillis. |
228 delaySemaphore := Semaphore new name:'delaySema'. |
228 delaySemaphore := Semaphore new name:'delaySema'. |
|
229 |
|
230 "Modified: / 31-05-2007 / 15:03:47 / cg" |
229 ! |
231 ! |
230 |
232 |
231 delaySemaphore |
233 delaySemaphore |
232 "return the semaphore used to resume the waiting process" |
234 "return the semaphore used to resume the waiting process" |
233 |
235 |
239 |
241 |
240 resumptionTime := aMillisecondTime. |
242 resumptionTime := aMillisecondTime. |
241 delaySemaphore := Semaphore new name:'delaySema'. |
243 delaySemaphore := Semaphore new name:'delaySema'. |
242 |
244 |
243 "Created: 18.4.1997 / 11:56:14 / stefan" |
245 "Created: 18.4.1997 / 11:56:14 / stefan" |
|
246 ! |
|
247 |
|
248 setDelayDuration:numberOfMillis |
|
249 "set the millisecond delta" |
|
250 |
|
251 millisecondDelta := numberOfMillis. |
|
252 |
|
253 "Created: / 31-05-2007 / 15:03:26 / cg" |
244 ! ! |
254 ! ! |
245 |
255 |
246 !Delay methodsFor:'delaying'! |
256 !Delay methodsFor:'delaying'! |
247 |
257 |
248 wait |
258 wait |
303 ! ! |
313 ! ! |
304 |
314 |
305 !Delay class methodsFor:'documentation'! |
315 !Delay class methodsFor:'documentation'! |
306 |
316 |
307 version |
317 version |
308 ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.37 2004-09-22 14:35:10 stefan Exp $' |
318 ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.38 2007-05-31 13:43:26 cg Exp $' |
309 ! ! |
319 ! ! |