From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA28690; Sun, 2 May 2004 16:24:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA28859 for ; Sun, 2 May 2004 16:24:44 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i42EOfEV012720 for ; Sun, 2 May 2004 16:24:42 +0200 Received: from [192.168.1.200] (ppp116-155.lns1.syd2.internode.on.net [150.101.116.155]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i42EOcZq072351; Sun, 2 May 2004 23:54:39 +0930 (CST) Subject: Re: [Caml-list] transactions? From: skaller Reply-To: skaller@users.sourceforge.net To: Benjamin Geer Cc: The Caml Trade In-Reply-To: <4094F956.3060206@socialtools.net> References: <1083468950.20722.189.camel@pelican.wigram> <4094F956.3060206@socialtools.net> Content-Type: text/plain Message-Id: <1083507877.20722.363.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 03 May 2004 00:24:37 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 409504A9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 threads:01 compiles:01 camlp:01 threads:01 unlocking:01 9660:01 glebe:01 ifdef:01 cmo:01 ocaml:01 blocking:01 nsw:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 2004-05-02 at 23:36, Benjamin Geer wrote: > skaller wrote: > > Is there an Ocaml eqivalent of begin/end blocking section? > > I.e. something that sets the global lock if threads > > are enabled (but still compiles if they're not)? > > You can use camlp4's pa_ifdef.cmo to create a global mutex only if > threads are enabled. The utility functions below take care of this, as > well as unlocking the mutex if an exception is thrown. Ah. OK. Thanks! -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners