[m-rev.] diff: Fix hlc.gc.par
Paul Bone
pbone at csse.unimelb.edu.au
Tue Apr 19 13:03:08 AEST 2011
Fix conditional compilation of some low-level thread safe code. This was
preventing the hlc.gc.par grade from compiling.
runtime/mercury_context.c:
runtime/mercury_thread.c:
As above.
Index: runtime/mercury_context.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_context.c,v
retrieving revision 1.91
diff -u -p -b -r1.91 mercury_context.c
--- runtime/mercury_context.c 15 Apr 2011 11:13:45 -0000 1.91
+++ runtime/mercury_context.c 19 Apr 2011 02:57:53 -0000
@@ -64,12 +64,9 @@ MR_init_context_maybe_generator(MR_Conte
/*---------------------------------------------------------------------------*/
-#ifdef MR_LL_PARALLEL_CONJ
+#if defined(MR_LL_PARALLEL_CONJ)
static void
MR_milliseconds_from_now(struct timespec *timeout, unsigned int msecs);
-#endif
-
-#ifdef MR_THREAD_SAFE
/*
** These states are bitfields so they can be combined when passed to
@@ -119,7 +116,7 @@ typedef struct {
static
engine_sleep_sync *engine_sleep_sync_data;
-#endif /* MR_THREAD_SAFE */
+#endif /* MR_LL_PARALLEL_CONJ */
/*
@@ -1206,7 +1203,7 @@ MR_check_pending_contexts(MR_bool block)
void
MR_schedule_context(MR_Context *ctxt)
{
-#ifdef MR_THREAD_SAFE
+#ifdef MR_LL_PARALLEL_CONJ
MR_EngineId engine_id;
union MR_engine_wake_action_data wake_action_data;
wake_action_data.MR_ewa_context = ctxt;
@@ -1259,7 +1256,7 @@ MR_schedule_context(MR_Context *ctxt)
}
}
}
-#endif
+#endif /* MR_LL_PARALLEL_CONJ */
MR_LOCK(&MR_runqueue_lock, "schedule_context");
ctxt->MR_ctxt_next = NULL;
Index: runtime/mercury_thread.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_thread.c,v
retrieving revision 1.46
diff -u -p -b -r1.46 mercury_thread.c
--- runtime/mercury_thread.c 13 Apr 2011 13:19:42 -0000 1.46
+++ runtime/mercury_thread.c 19 Apr 2011 02:57:53 -0000
@@ -447,7 +447,6 @@ void
MR_init_thread_stuff(void) {
int i;
- pthread_mutex_init(&MR_next_engine_id_lock, MR_MUTEX_ATTR);
pthread_mutex_init(&MR_global_lock, MR_MUTEX_ATTR);
#ifndef MR_THREAD_LOCAL_STORAGE
MR_KEY_CREATE(&MR_engine_base_key, NULL);
@@ -458,10 +457,13 @@ MR_init_thread_stuff(void) {
pthread_cond_init(&MR_thread_barrier_cond, MR_COND_ATTR);
#endif
+ #ifndef MR_HIGHLEVEL_CODE
+ pthread_mutex_init(&MR_next_engine_id_lock, MR_MUTEX_ATTR);
MR_all_engine_bases = MR_GC_malloc(sizeof(MercuryEngine*)*MR_num_threads);
for (i = 0; i < MR_num_threads; i++) {
MR_all_engine_bases[i] = NULL;
}
+ #endif
}
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20110419/1d4966c0/attachment.sig>
More information about the reviews
mailing list