WindowSensor.st
changeset 7826 ca8d4766615d
parent 7733 2b19dc622ad8
child 7855 46203abe7d57
child 7866 42dd768db07c
equal deleted inserted replaced
7825:07ea44507793 7826:ca8d4766615d
   886 
   886 
   887     |wasBlocked p|
   887     |wasBlocked p|
   888 
   888 
   889     p := Processor activeProcess.
   889     p := Processor activeProcess.
   890     wasBlocked := p blockInterrupts.
   890     wasBlocked := p blockInterrupts.
       
   891 
   891     [
   892     [
   892         Error handle:[:ex |
   893         whichLock critical:aBlock
   893             ('WindowSensor [Warning]: Error in eventQ handling ignored: ' , ex description) errorPrintCR.
   894     ] on:Error do:[:ex|
   894             "/ thisContext fullPrintAll.
   895         ('WindowSensor [Warning]: Error in eventQ handling ignored: ' , ex description) errorPrintCR.
   895             "/ whichLock printCR.
   896         "/ thisContext fullPrintAll.
   896             ex return
   897         "/ whichLock printCR.
   897         ] do:[
   898         ex return.
   898             whichLock critical:aBlock
       
   899         ]
       
   900     ] ensure:[
   899     ] ensure:[
   901         wasBlocked ifFalse:[
   900         wasBlocked ifFalse:[
   902             p unblockInterrupts.
   901             p unblockInterrupts.
   903         ]
   902         ]
   904     ]
   903     ]
   905 
   904 
   906     "Created: / 6.6.1998 / 21:04:02 / cg"
   905     "Created: / 06-06-1998 / 21:04:02 / cg"
   907     "Modified: / 14.10.1998 / 17:17:05 / cg"
   906     "Modified: / 14-10-1998 / 17:17:05 / cg"
       
   907     "Modified: / 31-01-2017 / 16:53:08 / stefan"
   908 !
   908 !
   909 
   909 
   910 criticalUserEventQueueAccess:aBlock
   910 criticalUserEventQueueAccess:aBlock
   911     "perform some action which needs synchronized (exclusive)
   911     "perform some action which needs synchronized (exclusive)
   912      access to the user event queue. 
   912      access to the user event queue.