Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1187.mcz==================== Summary ====================
Name: Morphic-mt.1187
Author: mt
Time: 29 June 2016, 9:36:32.707121 am
UUID: 9ec766fe-db1a-cd4f-957e-b95afcb2f8ff
Ancestors: Morphic-mt.1186
Fixes a bug with the Morphic main loop when the serverMode is enabled.
We still should double-check if we still need this 50-ms-hack to keep servers responsive. It should be the duty of the caller of #interCyclePause: to provide the 50 for servers.
=============== Diff against Morphic-mt.1186 ===============
Item was changed:
----- Method: WorldState>>interCyclePause: (in category 'update cycle') -----
interCyclePause: milliSecs
"delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is already expensive, then no delay occurs. However, if the system is idly waiting for interaction from the user, the method will delay for a proportionally long time and cause the overall CPU usage of Squeak to be low.
If the preference #serverMode is enabled, always do a complete delay of 50ms, independant of my argument. This prevents the freezing problem described in Mantis #6581"
| millisecondsToWait |
millisecondsToWait := Preferences serverMode
ifTrue: [ 50 ]
ifFalse: [
(lastCycleTime isNil or: [ CanSurrenderToOS == false ])
ifTrue: [ 0 ]
ifFalse: [ milliSecs - (Time millisecondsSince: lastCycleTime) ] ].
+ (Preferences serverMode or: [millisecondsToWait > 0 and: [millisecondsToWait <= milliSecs]])
+ ifTrue: [
+ (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
+ ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
+ ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
+ interCycleDelay wait ].
- (millisecondsToWait > 0 and: [millisecondsToWait <= milliSecs]) ifTrue: [
- (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
- ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
- ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
- interCycleDelay wait ].
lastCycleTime := Time millisecondClockValue.
CanSurrenderToOS := true.!