[project @ 2004-05-27 15:18:31 by simonmar]
Fix a nasty bug: when saving errno in the TSO after running a thread,
beware that the TSO might have moved, e.g. if the thread made a safe
foreign call in the threaded RTS and a GC happened.
We have to grab the new location of the TSO *before* saving errno.
MERGE TO STABLE
This was the most interesting bug hunt I've had in a while. The crash
only showed up in about 1 in 4 runs of a program with 1000 Haskell
threads, running on the threaded RTS. To make things worse, gdb
doesn't support watchpoints in programs with multiple threads... :-/