[m-rev.] diff: fix initialization order bug for hlc.par.gc

Peter Ross pro at missioncriticalit.com
Thu Oct 31 02:42:48 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 8
Branches: main

Fix a bug which caused a seg-fault with the Win32 version of the
pthread library.

runtime/mercury_wrapper.c:
	Move MR_init_thread_stuff() so that it is called before
	MR_init_memory() as MR_init_memory() refers to
	MR_engine_base_key which is initialised by
	MR_init_thread_stuff().

Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.111
diff -u -r1.111 mercury_wrapper.c
--- runtime/mercury_wrapper.c	25 Sep 2002 07:54:12 -0000	1.111
+++ runtime/mercury_wrapper.c	30 Oct 2002 15:38:40 -0000
@@ -441,6 +441,10 @@
 
 	(*MR_address_of_mercury_init_io)();
 
+#ifdef MR_THREAD_SAFE
+ 	MR_init_thread_stuff();
+#endif
+
 #if defined(MR_HIGHLEVEL_CODE) && defined(MR_CONSERVATIVE_GC)
 	MR_init_memory();
   #ifdef MR_USE_TRAIL
@@ -459,7 +463,6 @@
   #else
 	{
 		int i;
-		MR_init_thread_stuff();
 		MR_init_thread(MR_use_now);
 		MR_exit_now = MR_FALSE;
 		for (i = 1 ; i < MR_num_threads ; i++)

--------------------------------------------------------------------------
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