mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-19 07:45:09 +00:00
Estimated hours taken: 4.5 Branches: main Add a new foreign proc attribute `maybe_thread_safe' and a new compiler option `--maybe-thread-safe'. The thread safety of foreign procs that have the `maybe_thread_safety' attribute set is dependent upon the value of the `--maybe-thread-safe' option. This facility is intended for use in writing bindings to libraries whose thread safety is itself conditional. At quite an early stage `maybe_thread_safe' is turned into either `thread_safe' or `not_thread_safe' depending on the value of the `--maybe-thread-safe' option. In particular, it will appear as either `thread_safe' or `not_thread_safe' in any optimization interfaces. compiler/prog_io_pragma.m compiler/prog_data.m Parse the new foreign code attribute, `maybe_thread_safe'. Fix a place where the line width was > 79 characters. compiler/options.m: compiler/globals.m: compiler/handle_options.m: Add a new option `--maybe-thread-safe' that tells the compiler how to handle `maybe_thread_safe' foreign code attributes. compiler/make_hlds.m: Convert any `maybe_thread_safe' attributes into `thread_safe' or `not_thread_safe' attributes depending upon the value of the `--maybe-thread-safe' option. compiler/pragma_c_gen.m: Call unexpected/2 if we encounter the `maybe_thread_safe' attribute here, as it should have been replaced with either `thread_safe' or `not_thread_safe' by this point. doc/reference_manual.texi: doc/user_guide.texi: Document the new attribute and option. vim/syntax/mercury.vim: Highlight the new attribute.