WindowSensor.st
branchjv
changeset 7855 46203abe7d57
parent 7735 16d70a0e8245
parent 7826 ca8d4766615d
equal deleted inserted replaced
7854:295325696e0d 7855:46203abe7d57
   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.