← Back to team overview

marionnet-dev team mailing list archive

[Branch ~marionnet-drivers/ocamlbricks/trunk] Rev 292: Added function ThreadExtra.set_killable_with_thunk that allows a thread to give to the other thre...

 

------------------------------------------------------------
revno: 292
committer: Jean-Vincent Loddo <loddo@xxxxxxxxxxxxxxxxxxxx>
branch nick: ocamlbricks
timestamp: Mon 2012-01-09 00:25:25 +0100
message:
  Added function ThreadExtra.set_killable_with_thunk that allows a thread to give to the other threads a mean to kill it. For instance, a server waiting for connections on listening socket may subscribe itself to the list of killable threads by a call like the following:       
  
  let shutdown () = Unix.shutdown listen_socket Unix.SHUTDOWN_RECEIVE in
  ThreadExtra.set_killable_with_thunk (fun () -> shutdown ())
  
  Also added functions for delayed killing (a thread is created to perform the action after the delay):
  val delayed_kill    : float -> Thread.t -> unit
  val delayed_killall : float -> unit
  val delayed_id_kill : float -> int -> unit
modified:
  EXTRA/filenameExtra.ml
  EXTRA/limbo.ml
  EXTRA/threadExtra.ml
  EXTRA/threadExtra.mli


--
lp:ocamlbricks
https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk

Your team marionnet-dev is subscribed to branch lp:ocamlbricks.
To unsubscribe from this branch go to https://code.launchpad.net/~marionnet-drivers/ocamlbricks/trunk/+edit-subscription