Permalink
Browse files

Scap previous implementation and use select.

  • Loading branch information...
1 parent 9afdbbf commit 86c54ceecda9167da40cd4a56952a28dc96cf587 @toots toots committed Mar 28, 2013
Showing with 13 additions and 0 deletions.
  1. +2 −0 CHANGES
  2. +11 −0 src/duppy.ml
View
@@ -2,6 +2,8 @@
=====
* Remove Panic exception and let original exception bubble through.
* Removed win32 select work-around: patch applied upstream.
+* Added dummy [select] calls before submitting a task to try to
+ protect against exceptions when calling actual [select]
0.4.2 (08-10-2011)
=====
View
@@ -105,6 +105,17 @@ struct
let time () = Unix.gettimeofday ()
let rec t_of_task (task:('a,[<event])task) =
+ (** Test task sockets *)
+ let prepare = function
+ | `Read socket ->
+ ignore(Unix.select [socket] [] [] 0.)
+ | `Write socket ->
+ ignore(Unix.select [] [socket] [] 0.)
+ | `Exception socket ->
+ ignore(Unix.select [] [] [socket] 0.)
+ | `Delay _ -> ()
+ in
+ List.iter prepare task.events;
let t0 = time () in
{ timestamp = t0 ; prio = task.priority ;
enrich = (fun e ->

0 comments on commit 86c54ce

Please sign in to comment.