added the --debug option for the debug build

This commit is contained in:
hyunghwan.chung
2017-12-16 16:14:23 +00:00
parent 49f0ff0bda
commit e9cea47273
11 changed files with 134 additions and 56 deletions

View File

@ -228,30 +228,27 @@ method(#class,#abstract) xxx. => method(#class) xxx { self subclassResponsibilit
## create an internal semaphore for timeout notification.
s := Semaphore new.
## grant the partial membership to the internal semaphore.
## it's partial because it's not added to self.semarr.
##s _group: self.
self addSemaphore: s.
## arrange the processor to notify upon timeout.
System signal: s after: seconds.
[
## arrange the processor to notify upon timeout.
System signal: s afterSecs: seconds.
## wait on the semaphore group.
r := self wait.
## if the internal semaphore has been signaled,
## arrange to return nil to indicate timeout.
if (r == s) { r := nil }
elsif (r signalAction notNil) { r signalAction value: r }.
if (r == s) { r := nil } ## timed out
elsif (r signalAction notNil) { r signalAction value: r }. ## run the signal action block
] ensure: [
## System<<unsignal: doesn't thrown an exception even if the semaphore s is not
## register with System<<signal:afterXXX:. otherwise, i would do like this line
## commented out.
## [ System unsignal: s ] ensure: [ self removeSemaphore: s ].
## nullify the membership
self removeSemaphore: s.
## cancel the notification arrangement in case it didn't time out.
System unsignal: s.
self removeSemaphore: s
].
^r.

View File

@ -115,7 +115,6 @@ class MyObject(Object)
[ self test_mutex = #(2000 6000) ],
####[ self test_sem_sig ],
[ System sleepForSecs: 2. self.a == 300 ] ## sleep before checking self.a to prevent different result depending on process switching frequency and speed
).