[m-rev.] for review: add maybe_thread_safe attribute

Ian MacLarty maclarty at cs.mu.OZ.AU
Thu Feb 24 13:40:05 AEDT 2005


On Mon, Feb 21, 2005 at 05:29:05PM +1100, Julien Fischer wrote:
> 
> compiler/make_hlds.m:
> 	Convert a any `maybe_thread_safe' attributes into `thread_safe'

Should that `a' be there?

> Index: compiler/globals.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/globals.m,v
> retrieving revision 1.64
> diff -u -r1.64 globals.m
> --- compiler/globals.m	27 Jan 2005 03:38:06 -0000	1.64
> +++ compiler/globals.m	19 Feb 2005 17:00:57 -0000
> @@ -100,11 +100,15 @@
>  	% Map from module name to file name.
>  :- type source_file_map == map(module_name, string).
> 
> +:- type maybe_thread_safe == bool.
> +
>  :- pred convert_target(string::in, compilation_target::out) is semidet.
>  :- pred convert_foreign_language(string::in, foreign_language::out) is semidet.
>  :- pred convert_gc_method(string::in, gc_method::out) is semidet.
>  :- pred convert_tags_method(string::in, tags_method::out) is semidet.
>  :- pred convert_termination_norm(string::in, termination_norm::out) is semidet.
> +:- pred convert_maybe_thread_safe(string::in, maybe_thread_safe::out)
> +	is semidet.
> 

This new predicate doesn't appear to be used anywhere in this diff.

> Index: compiler/handle_options.m
> ===================================================================
> @@ -263,6 +264,16 @@
>  		add_error("Invalid argument to option `--suppress-trace'.",
>  			!Errors)
>  	),
> +	map__lookup(OptionTable0, maybe_thread_safe, MaybeThreadSafeOption),
> +	( MaybeThreadSafeOption = string("yes") ->
> +		MaybeThreadSafe = yes
> +	; MaybeThreadSafeOption = string("no") ->
> +		MaybeThreadSafe = no

Perhaps you should use convert_maybe_thread_safe here?

> +	;
> +		MaybeThreadSafe = no, % dummy
> +		add_error("Invalid argument to option `--maybe-thread-safe'.",
> +			!Errors)
> +	),

> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.421
> diff -u -r1.421 user_guide.texi
> --- doc/user_guide.texi	18 Feb 2005 04:05:33 -0000	1.421
> +++ doc/user_guide.texi	21 Feb 2005 06:24:57 -0000
> @@ -6256,6 +6256,16 @@
>  or for backtrackable destructive update.
>  This option is not yet supported for the IL or Java back-ends.
> 
> + at sp 1
> + at item @code{--maybe-thread-safe @{yes, no@}}
> + at findex --maybe-thread-safe
> +Specify how to treate the @samp{maybe_thread_safe} foreign code
> +attribute.  @samp{yes} means that a foreign procedure with the
> + at samp{maybe_thread_safe} option is treated as thought is has a

s/thought/though/

Otherwise looks good.

Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list