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 QAA21766; Fri, 8 Nov 2002 16:25:32 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA21215 for ; Fri, 8 Nov 2002 16:25:31 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from kraid.nerim.net (kraid.nerim.net [62.4.16.95]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gA8FPU506300 for ; Fri, 8 Nov 2002 16:25:30 +0100 (MET) Received: from hector.lesours (lesours.starynkevitch.net [80.65.224.217]) by kraid.nerim.net (Postfix) with ESMTP id 5203341257 for ; Fri, 8 Nov 2002 16:11:10 +0100 (CET) Received: from basile by hector.lesours with local (Exim 3.36 #1 (Debian)) id 18AAwR-0007ok-00 for ; Fri, 08 Nov 2002 16:21:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15819.54873.817342.980555@hector.lesours> Date: Fri, 8 Nov 2002 16:20:57 +0100 To: caml_list@inria.fr Subject: [Caml-list] recursive mutexes? X-Mailer: VM 7.07 under Emacs 21.2.2 From: Basile STARYNKEVITCH Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear All, Does the Mutex module allow "recursive" mutexes, so can I code something like let mylock = Mutex.create ();; let innerf () = Mutex.lock mylock; Printf.printf "in innerf\n"; Mutex.unlock mylock ;; let f () = Mutex.lock mylock; (* do something complicated, then ... *) innerf (); Mutex.unlock mylock ;; I expect that the lock in innerf always succeed, since mylock is already locked by the same thread in the caller function f. Am I right in thinking so? (the reference manual is not fully clear on this, and it is an important point). FWIW my plateform is Linux/x86 with pthreads but I would like a "definitive" statement from our Inria team on this point. AFAIK some Posix threads accept recursive locking. regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet alias: basiletunesorg 8, rue de la Faïencerie, 92340 Bourg La Reine, France ------------------- 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