From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBHKbF5n009490 for ; Sat, 17 Dec 2011 21:37:15 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmYCAO/77E7AbSoIe2dsb2JhbABDhQymSyIBARYmBCGBcgEBBSMEUhALCQ8CAiYCAhQYMYgPpXeRDROBHIk/M2MEjUSHOZIw X-IronPort-AV: E=Sophos;i="4.71,369,1320620400"; d="scan'208";a="135869328" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Dec 2011 21:37:10 +0100 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178025225.adsl.alicedsl.de [85.178.25.225]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id pBHKb856019580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 17 Dec 2011 21:37:08 +0100 Received: by first (Postfix, from userid 1000) id 2DBAA1540253; Sat, 17 Dec 2011 21:37:08 +0100 (CET) Date: Sat, 17 Dec 2011 21:37:08 +0100 From: oliver To: Matej Kosik Cc: caml-list@inria.fr Message-ID: <20111217203708.GB1769@siouxsie> References: <4EEC9990.3000102@fiit.stuba.sk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4EEC9990.3000102@fiit.stuba.sk> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] Thread.exit Hello, On Sat, Dec 17, 2011 at 01:30:56PM +0000, Matej Kosik wrote: > Hello, > > I use the threads library. > > I would like to ask if > > Thread.exit > > must have the following type: > > unit -> unit > > instead of: > > unit -> 'a > > i.e. the same as the type of Pervasives.exit. > > In my code: > > let bits = try receive () > with Channel.End -> close (); > Thread.exit (); > exit 0 > in > > I must make a bogus call "exit 0" empty to make the type-checker happy. > If "Thread.exit" had the same type as "Pervasives.empty", it would > not be necessary. [...] If you have type problems, the surrounding code will await a type different than unit; "bits" looks like int... Also you should be aware that Pervasives.exit exits the whole process, but Threads.exit terminates only the thread. Ciao, Oliver