English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Problem with try_lock on win32.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-01-27 (02:40)
From: Romain Beauxis <romain.beauxis@g...>
Subject: Problem with try_lock on win32.
	Hi all !

I have a problem with the following code under win32:

let m = Mutex.create ()

let () =
  Mutex.lock m;
  if Mutex.try_lock m then
    Printf.printf "locked !\n"
    Printf.printf "could not lock!\n"

When run, the program outputs: "locked !"

Obviously, this is not the intented behaviour..

Do you know what is wrong ? Is there something I am missing ??