In Pharo the Delay>>wait for one second will not expire anytime soon
in a new image. Use the depedency handling so we can terminate and
restart the loop.
Avoid the dispatcher process from being terminated. Dispatch the
block in a new context. This is easier than detecting the termination
and then respawn it.
Remove the PackageLoader fileInPackage statement as it is conflicting
with the export as there is no PackageLoader in Pharo. Add a Makefile
to help with invoking the export and create a compat_for_pharo.st for
the methods not provided by Pharo. The testcase is working now.
Make sure that we only remove from one process, this way we can
check if the list is empty without having a lock. The list is sorted
so even if we get interrupted between the [condition] whileFalse: [res]
and someone adds an older timer, it is okay to use this timer.
When dispatching everything in the same context we avoid all kind
of issues with locking. If we use a truely multi threaded VM we could
probably use multiple dispatchers.