Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2005-05-23 12:56:51 -0700 (Mon, 23 May 2005)
Revision: 1056
Log message:
Fixed the problem with output on Win32.
- Win32 uses threads instead of fork (Unix uses fork
so it doesn't have this problem).
- Threads are run with the usual pipe through another
IO thread that prints the output.
- So when a thread calls Pervasives.exit directly, omake
may exit before the IO threads are finished (and
so the output gets lost).
The solution is to have the omake exit function raise an
exception instead of calling Pervasives.exit.
I'm a little worried about this scheme for two reasons.
1. We need to make sure the ExitEception is handled
properly in all the right exception handlers.
2. In general, we shouldn't allow omake to exit until
all threads have finished. I believe this is done,
but I am not positive.
Also, I fixed the ./mpopt.bat problem. The issue a Win32
"feature". OMake executes a command like ./x with
executable = absolute pathname of ./x (using \ as a separator).
argv[0] = ./x
This is entirely sensible to me, but Win2 doesn't like it.
So the fix is to replace argv[0] with the absolute pathname.
In any case, we should make the OMakefiles as consistent as
possible, and remove the path separator for mpopt.bat that
Yegor introduced (BTW, if you ever really needed it, you should
use the SLASH variable instead of something new).