Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Scap previous implementation and use select.

  • Loading branch information...
commit 86c54ceecda9167da40cd4a56952a28dc96cf587 1 parent 9afdbbf
@toots toots authored
Showing with 13 additions and 0 deletions.
  1. +2 −0  CHANGES
  2. +11 −0 src/duppy.ml
View
2  CHANGES
@@ -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
11 src/duppy.ml
@@ -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 ->
Please sign in to comment.
Something went wrong with that request. Please try again.