diff options
author | Romain Beauxis <toots@debian.org> | 2008-04-15 16:43:46 +0000 |
---|---|---|
committer | Romain Beauxis <toots@debian.org> | 2008-04-15 16:43:46 +0000 |
commit | f7ed5917702acf1b2bcce283018b663264585d5c (patch) | |
tree | 1ee985eb0d8f73950fc889b9568f1d0e4e02186c /src | |
parent | 239a0275d68c749497790958134c3af322d38857 (diff) |
Imported Upstream version 0.1.1
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/duppy.ml | 11 | ||||
-rw-r--r-- | src/duppy.mli | 10 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index c527d0e..569ad62 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -26,7 +26,7 @@ OCAMLLIBPATH = @CAMLLIBPATH@ SOURCES = duppy.ml duppy.mli RESULT = duppy OCAMLDOCFLAGS = -stars -LIBINSTALL_FILES = $(wildcard *.mli *.cmi *.cma *.cmxa *.a *.so) +LIBINSTALL_FILES = $(wildcard *.mli *.cmi *.cma *.cmxa *.cmx *.a *.so) ACLIBS = @LIBS@ LDFLAGS = @LDFLAGS@ CLIBS = $(ACLIBS:-l%=%) diff --git a/src/duppy.ml b/src/duppy.ml index bdf96d0..48c8420 100644 --- a/src/duppy.ml +++ b/src/duppy.ml @@ -238,8 +238,15 @@ let queue ?log ?(priorities=fun _ -> true) s name = Mutex.unlock s.select_m ; if s.ready <> [] then List.iter Condition.signal s.queues - end else - Condition.wait c m + end else begin + (* We follow the spec on the mutex, + * otherwise we might get issues on bsd systems + * or any implementation that cares more about + * mutex locking/unlocking than linux/glibc.. *) + Mutex.lock m; + Condition.wait c m; + Mutex.unlock m + end end done diff --git a/src/duppy.mli b/src/duppy.mli index a778cd9..8b052e7 100644 --- a/src/duppy.mli +++ b/src/duppy.mli @@ -142,7 +142,17 @@ sig * With {!Duppy.Io.write}, the schdeduler will try to write recursively to the file descriptor * the given string.*) + (** Type for markers. + * + * [Split s] recognizes all regexp allowed by the + * [Pcre] module. *) type marker = Length of int | Split of string + + (** Different types of failure. + * + * [Int d] is raised when reading or writing failed. + * the returned value is respectively the ammount of + * data read or written *) type failure = Int of int | Unix of Unix.error*string*string (** Wrapper to perform a read on a socket and trigger a function when |