[m-dev.] diff: move the initialisation of MR_mmc_options in MR_trace_event_external()

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 22 11:26:22 AEST 1999


On 22-May-1999, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> Fergus Henderson wrote:
> 
> > 	static bool MR_mmc_options_initialized = FALSE;
> > 	if (!MR_mmc_options_initialized) {
> > 		... initialization goes here ...
> > 		MR_mmc_options_initialized = TRUE;
> > 	}
> 
> This code isn't thread-safe for obvious reasons.

Good point.

> Does that make a difference?

At the moment, no; support for multithreading in the Mercury debugger
is a long way off.  But when we have the parallel/multithreaded
version of Mercury working, we would eventually like to support
multithreaded debugging.  So it would be better to avoid non-thread-safe
constructs if we can.

I had a more detailed look at the order of initialization, and I think
it should be OK to initialize MR_mmc_options in MR_trace_init_external.
So doing the initialization there is probably a better idea.

-- 
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list