mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-28 15:54:18 +00:00
Estimated hours taken: 1
Branches: main, release
Get rid of the `thread_safe' mutable attribute, since this doesn't actually
make access to a mutable thread safe (in fact it makes them less thread
safe than the `not_thread_safe' version).
By extension this also removes support for the `not_thread_safe' mutable
attribute.
compiler/prog_io.m:
compiler/prog_item.m:
compiler/prog_mutable.m:
Remove support for the `thread_safe' mutable attribute.
compiler/make_hlds_passes.m:
Remove support for the `thread_safe' mutable attribute.
Mark the foreign clauses for `get' predicates for constant
mutables as thread safe.
doc/reference_manual.texi:
Delete the documentation for the `thread_safe' mutable attribute.
tests/hard_coded/mutable_decl.m:
tests/hard_coded/pure_mutable.m:
tests/hard_coded/trace_goal_env_1.m:
tests/hard_coded/trace_goal_env_2.m:
tests/hard_coded/unusual_name_mutable.m:
tests/hard_coded/sub-modules/mutable_child.m:
tests/hard_coded/sub-modules/mutable_grandchild.m:
tests/hard_coded/sub-modules/mutable_parent.m:
tests/invalid/bad_mutable.{err_exp,m}:
tests/invalid/not_in_interface.m:
Conform to the above change.
22 lines
583 B
Mathematica
22 lines
583 B
Mathematica
:- module mutable_parent.mutable_child.
|
|
|
|
:- interface.
|
|
|
|
:- pred run_child(io::di, io::uo) is det.
|
|
|
|
:- include_module mutable_grandchild.
|
|
|
|
:- implementation.
|
|
|
|
:- mutable(child_global, int, 200, ground,
|
|
[untrailed, attach_to_io_state]).
|
|
|
|
run_child(!IO) :-
|
|
io.write_string("In child ...\n", !IO),
|
|
get_parent_global(ParentGlobal, !IO),
|
|
get_child_global(ChildGlobal, !IO),
|
|
io.format(" parent_global = %d\n", [i(ParentGlobal)], !IO),
|
|
io.format(" child_global = %d\n", [i(ChildGlobal)], !IO),
|
|
set_parent_global(ParentGlobal + 1, !IO),
|
|
set_child_global(ChildGlobal + 1, !IO).
|