mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
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.
2 lines
3 B
Plaintext
2 lines
3 B
Plaintext
ok
|