diff: document c_code default attributes

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 5 18:47:29 AEDT 1998


Estimated hours taken: 0.5

doc/reference_manual.texi:
	Document the default values of the c_code attributes:
	`may_call_mercury' and `not_thread_safe'.

Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.111
diff -u -r1.111 reference_manual.texi
--- reference_manual.texi	1998/11/05 06:42:46	1.111
+++ reference_manual.texi	1998/11/05 07:44:16
@@ -3539,13 +3539,17 @@
 
 @item @samp{may_call_mercury}/@samp{will_not_call_mercury}
 This attribute declares whether or not execution inside this C code may
-call back into Mercury or not.  If you specify @samp{will_not_call_mercury},
+call back into Mercury or not.  The default, in case neither is specified,
+is @samp{may_call_mercury}.  Specifying @samp{will_not_call_mercury}
+may allow the compiler to generate more efficient code.
+If you specify @samp{will_not_call_mercury},
 but the C code @emph{does} invoke Mercury code, then the behaviour is
 undefined.
 
 @item @samp{thread_safe}/@samp{not_thread_safe}
 This attribute declares whether or not it is safe for multiple threads
 to execute this C code concurrently.
+The default, in case neither is specified, is @samp{not_thread_safe}.
 If the C code is declared @samp{thread_safe}, then the Mercury implementation
 is permitted to execute the code concurrently from multiple threads without
 taking any special precautions.  If the C code is declared
@@ -3560,8 +3564,6 @@
 and release a mutex.  All non-thread-safe C code shares a single mutex.]
 @c XXX this can cause deadlocks if not_thread_safe C code calls
 @c     Mercury which calls C
-
- at c XXX document the default values
 
 @end table
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list