Monitor.st
changeset 709 5a8ddf63e001
parent 699 01af80ac55c5
child 710 b17b877ac7b4
equal deleted inserted replaced
708:533ec9a28b76 709:5a8ddf63e001
   143 
   143 
   144     wasBlocked := OperatingSystem blockInterrupts.
   144     wasBlocked := OperatingSystem blockInterrupts.
   145     [
   145     [
   146         [owningProcess notNil] whileTrue:[
   146         [owningProcess notNil] whileTrue:[
   147             thisProcess state:#monWait.
   147             thisProcess state:#monWait.
   148             sema wait.
   148             (sema waitWithTimeout:10) isNil ifTrue:[
       
   149                 (owningProcess notNil and:[owningProcess isDead]) ifTrue:[
       
   150                     'Monitor [warning]: aquire monitor from dead process' errorPrintCR.
       
   151                     owningProcess := nil.
       
   152                 ]
       
   153             ]
   149         ].
   154         ].
   150         count := 1.
   155         count := 1.
   151         owningProcess := thisProcess.
   156         owningProcess := thisProcess.
   152     ] valueOnUnwindDo:[
   157     ] valueOnUnwindDo:[
   153         wasBlocked ifFalse:[OperatingSystem unblockInterrupts]
   158         wasBlocked ifFalse:[OperatingSystem unblockInterrupts]
   154     ]
   159     ]
   155 
   160 
   156     "Modified: / 14.10.1998 / 14:11:29 / cg"
   161     "Modified: / 11.12.1998 / 12:38:48 / cg"
   157 !
   162 !
   158 
   163 
   159 exit
   164 exit
   160     "exit the monitor"
   165     "exit the monitor"
   161 
   166 
   219 ! !
   224 ! !
   220 
   225 
   221 !Monitor class methodsFor:'documentation'!
   226 !Monitor class methodsFor:'documentation'!
   222 
   227 
   223 version
   228 version
   224     ^ '$Header: /cvs/stx/stx/libbasic2/Monitor.st,v 1.10 1998-10-14 13:11:59 cg Exp $'
   229     ^ '$Header: /cvs/stx/stx/libbasic2/Monitor.st,v 1.11 1998-12-11 11:57:54 cg Exp $'
   225 ! !
   230 ! !