Files
mercury/tests/hard_coded/test_semaphore.exp
Peter Wang 16a943044f The thread.yield', semaphore.wait', `semaphore.signal' procedures were
Estimated hours taken: 1
Branches: main

The `thread.yield', `semaphore.wait', `semaphore.signal' procedures were
crashing in debug and deep profiling grades.  The problem is that they caused
the calling context to suspend but resume in an auxiliary function instead of
back into the foreign_proc, so code inserted at the end of the foreign_proc by
those transforms wouldn't be executed.

Work around this by reverting to the original method of taking the address of
labels so that suspended contexts will resume back within the foreign_proc.

library/thread.m:
library/thread.semaphore.m:
	#define ML_THREAD_AVOID_LABEL_ADDRS if execution tracing or deep
	profiling are enabled in low-level C grades.

	In the problematic foreign_procs, test for ML_THREAD_AVOID_LABEL_ADDRS
	and use the workaround if necessary.

	Unrelated: add missing `tabled_for_io' attributes on foreign_procs in
	these modules.

tests/hard_coded/Mmakefile:
tests/hard_coded/test_semaphore.exp:
tests/hard_coded/test_semaphore.m:
tests/hard_coded/test_yield.exp:
tests/hard_coded/test_yield.m:
	Add test cases.
2007-10-24 00:50:01 +00:00

2 lines
3 B
Plaintext