Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
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