diff: fix bootstrapping problem with conway's change
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Dec 17 03:34:52 AEDT 1998
Estimated hours taken: 0.5
Fix a bootstrapping problem with the changes to MR_OBTAIN_GLOBAL_C_LOCK()
that Tom Conway recently committed.
runtime/mercury_thread.h:
compiler/pragma_c_gen.m:
Rename MR_{OBTAIN,RELEASE}_GLOBAL_C_LOCK()
as MR_{OBTAIN,RELEASE}_GLOBAL_LOCK().
Also delete the unnecessary trailing semicolons
from the definitions of those macros.
runtime/mercury_bootstrap.h:
Add a definition of the old zero-arity MR_*_GLOBAL_C_LOCK() macros
in terms of the new unary MR_*_GLOBAL_LOCK() macros.
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.24
diff -u -r1.24 pragma_c_gen.m
--- pragma_c_gen.m 1998/12/15 00:21:27 1.24
+++ pragma_c_gen.m 1998/12/16 16:28:15
@@ -389,10 +389,10 @@
;
module_info_pred_info(ModuleInfo, PredId, PredInfo),
pred_info_name(PredInfo, Name),
- string__append_list(["\tMR_OBTAIN_GLOBAL_C_LOCK(""",
+ string__append_list(["\tMR_OBTAIN_GLOBAL_LOCK(""",
Name, """);\n"], ObtainLockStr),
ObtainLock = pragma_c_raw_code(ObtainLockStr),
- string__append_list(["\tMR_RELEASE_GLOBAL_C_LOCK(""",
+ string__append_list(["\tMR_RELEASE_GLOBAL_LOCK(""",
Name, """);\n"], ReleaseLockStr),
ReleaseLock = pragma_c_raw_code(ReleaseLockStr)
},
Index: runtime/mercury_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.3
diff -u -r1.3 mercury_bootstrap.h
--- mercury_bootstrap.h 1998/11/11 02:14:15 1.3
+++ mercury_bootstrap.h 1998/12/16 16:27:50
@@ -63,4 +63,10 @@
#define TYPELAYOUT_TYPEINFO_VALUE (MR_TYPELAYOUT_TYPEINFO_VALUE)
#define TYPELAYOUT_C_POINTER_VALUE (MR_TYPELAYOUT_C_POINTER_VALUE)
+/*
+** The code generated by Mercury 0.8 includes references to these macros.
+*/
+#define MR_OBTAIN_GLOBAL_C_LOCK() MR_OBTAIN_GLOBAL_LOCK("pragma c code")
+#define MR_RELEASE_GLOBAL_C_LOCK() MR_RELEASE_GLOBAL_LOCK("pragma c code")
+
#endif /* MERCURY_BOOTSTRAP_H */
Index: runtime/mercury_thread.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_thread.h,v
retrieving revision 1.4
diff -u -r1.4 mercury_thread.h
--- mercury_thread.h 1998/12/15 00:22:27 1.4
+++ mercury_thread.h 1998/12/16 16:25:29
@@ -57,11 +57,8 @@
** predicates which are not thread-safe.
** See the comments below.
*/
- #define MR_OBTAIN_GLOBAL_C_LOCK(where) MR_LOCK(&MR_global_lock, \
- (where));
-
- #define MR_RELEASE_GLOBAL_C_LOCK(where) MR_UNLOCK(&MR_global_lock, \
- (where));
+ #define MR_OBTAIN_GLOBAL_LOCK(where) MR_LOCK(&MR_global_lock, (where))
+ #define MR_RELEASE_GLOBAL_LOCK(where) MR_UNLOCK(&MR_global_lock, (where))
#if defined(MR_DIGITAL_UNIX_PTHREADS)
#define MR_GETSPECIFIC(key) ({ \
--
Fergus Henderson <fjh at cs.mu.oz.au> | "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh> | but source code lives forever"
PGP: finger fjh at 128.250.37.3 | -- leaked Microsoft memo.
More information about the developers
mailing list