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
Thread.delay afraid of SIGTERM
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Thread.delay afraid of SIGTERM

>From http://ocamlunix.forge.ocamlcore.org/threads.html#htoc63 :

val delay : float -> unit
This primitive is provided for portability with vm-level threads, but
delay s is simply an abbreviation for ignore (Unix.select [] [] [] s).
This call, unlike join, is not restarted when it is interrupted by a

So the error you see here is Unix.EINTR: the call to select in delay
is interrupted by your signal. For more information about Unix.EINTR :


As for the difference with Unix.sleep, the latter does not raise EINTR
on signal interruption it just returns earlier with the unslept amount
(which is not reported in OCaml), see sleep(3).