mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 18:03:36 +00:00
Estimated hours taken: 3
Branches: main
Fix a potential deadlock with the recently added library predicate
io.update_globals/3.
library/io.m:
If the closure passed to io.update_globals/3 throws an exception then
we need to release the lock associated with the globals before
propagating the exception upwards. Failing to do so means that the
any subsequent call to io.{set,get,update}_globals will block
indefinitely.
tests/hard_coded/Mmakefile:
tests/hard_coded/io_globals_deadlock.{m,exp}:
Test case for the above.
3 lines
58 B
Plaintext
3 lines
58 B
Plaintext
update_pred_1 threw exception.
|
|
Final value of Globals = 3
|