'From etoys3.0 of 7 March 2008 [latest update: #2117] on 29 August 2008 at 5:22:07 pm'! "Change Set: dbusObjects6-bf Date: 29 August 2008 Author: Bert Freudenberg Allow multiple evaluation of dbus handlers (#8210): Name: DBus-Objects-bf.6 Author: bf Time: 29 August 2008, 5:21:41 pm UUID: 6a6986d5-4ed1-4a0d-b4b7-87a397fa979b Ancestors: DBus-Objects-bf.5 - fix message handler copying for evaluation"! !DBus methodsFor: 'mainloop' stamp: 'bf 8/29/2008 16:07'! 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 copy valueWithArguments: {msg}] fixTemps]]. msg isReplyOrError ifTrue: [(replyHandlers removeKey: msg replySerial ifAbsent: []) ifNotNilDo: [:handler | actions add: [handler handleReplyOrError: msg]]] ifFalse: [actions add: [self dispatchMessage: msg]]]. actions do: [:action | action forkAt: Processor activePriority - 5 named: self printString, ' handler ', msg serial asString]! ! !DBus methodsFor: 'matching' stamp: 'bf 8/29/2008 15:55'! onMatch: aDBusMatch do: aBlockOrMessageSend accessLock critical: [ self primAddMatch: aDBusMatch matchString squeakToUtf8. matchHandlers at: aDBusMatch put: aBlockOrMessageSend fixTemps]! !