'From etoys3.0 of 7 March 2008 [latest update: #2091] on 26 August 2008 at 5:01:50 pm'! "Change Set: dbusObjects5-bf Date: 26 August 2008 Author: Bert Freudenberg Name: DBus-Objects-bf.5 Author: bf Time: 26 August 2008, 5:00:24 pm UUID: 46e0b6da-8aaa-4ac3-bc71-d9a126c710eb Ancestors: DBus-Objects-bf.4 - use copy of blocks when handling messages to facilitate parallel evaluation"! !DBus methodsFor: 'mainloop' stamp: 'bf 8/26/2008 16:59'! handleMessage: msg | actions | self logDebug: self asString, ' received ', msg asString. "take care to not call handlers while accessLock is held, they could block" actions := OrderedCollection new. accessLock critical: [ matchHandlers keysAndValuesDo: [:match :handler | (match matches: msg) ifTrue: [ actions add: [handler valueWithArguments: {msg}] copy fixTemps]]. msg isReplyOrError ifTrue: [(replyHandlers removeKey: msg replySerial ifAbsent: []) ifNotNilDo: [:handler | actions add: [handler handleReplyOrError: msg] copy fixTemps]] ifFalse: [actions add: [self dispatchMessage: msg] copy fixTemps]]. actions do: [:action | action forkNamed: self printString, ' handler ', msg serial asString]! !