[Pkg-ocaml-maint-commits] [SCM] Cooperative light-weight thread library for OCaml branch, master, updated. debian/2.3.1-1-5-g3281c74

Stephane Glondu steph at glondu.net
Sat Dec 31 09:12:42 UTC 2011


The following commit has been merged in the master branch:
commit 3281c74f058dc36ab619008cc852301f6bf66ced
Author: Stephane Glondu <steph at glondu.net>
Date:   Sat Dec 31 10:10:09 2011 +0100

    Refresh patches

diff --git a/debian/patches/0001-Do-not-build-manual-manual.pdf.patch b/debian/patches/0001-Do-not-build-manual-manual.pdf.patch
index 05af968..3a8b94e 100644
--- a/debian/patches/0001-Do-not-build-manual-manual.pdf.patch
+++ b/debian/patches/0001-Do-not-build-manual-manual.pdf.patch
@@ -7,7 +7,7 @@ Subject: Do not build manual/manual.pdf
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/setup.ml b/setup.ml
-index 8e925d1..91ad1db 100644
+index f799762..89f1a90 100644
 --- a/setup.ml
 +++ b/setup.ml
 @@ -5160,7 +5160,7 @@ let setup_t =
diff --git a/debian/patches/0002-fix-a-race-condition-in-Lwt_io.patch b/debian/patches/0002-fix-a-race-condition-in-Lwt_io.patch
deleted file mode 100644
index 2dac1fe..0000000
--- a/debian/patches/0002-fix-a-race-condition-in-Lwt_io.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From: Jeremie Dimino <jeremie at dimino.org>
-Date: Thu, 28 Jul 2011 13:23:03 +0200
-Subject: fix a race condition in Lwt_io
-
-Origin: http://ocsigen.org/darcsweb/?r=lwt;a=commit;h=20110718145731-c41ad-7ced2812fef6069e83864996a274e5e55db1aaf4.gz
----
- src/unix/lwt_io.ml |   30 ++++++++++++++++++------------
- 1 files changed, 18 insertions(+), 12 deletions(-)
-
-diff --git a/src/unix/lwt_io.ml b/src/unix/lwt_io.ml
-index ce2b36c..28d8935 100644
---- a/src/unix/lwt_io.ml
-+++ b/src/unix/lwt_io.ml
-@@ -58,6 +58,9 @@ type 'mode state =
-       (* An atomic operations is being performed on the channel. The
-          argument is the temporary atomic wrapper. *)
- 
-+  | Waiting_for_busy
-+      (* A queued operation has not yet started. *)
-+
-   | Idle
-       (* The channel is unused *)
- 
-@@ -169,7 +172,7 @@ let is_busy ch =
-         raise (invalid_channel ch.channel)
-     | Idle | Closed ->
-         false
--    | Busy_primitive | Busy_atomic _ ->
-+    | Busy_primitive | Busy_atomic _ | Waiting_for_busy ->
-         true
- 
- (* Flush/refill the buffer. No race condition could happen because
-@@ -226,7 +229,7 @@ let perform_io ch = match ch.main.state with
-   | Invalid ->
-       raise_lwt (invalid_channel ch)
- 
--  | Idle ->
-+  | Idle | Waiting_for_busy ->
-       assert false
- 
- let refill = perform_io
-@@ -259,7 +262,7 @@ let auto_flush oc =
-   lwt () = Lwt.pause () in
-   let wrapper = deepest_wrapper oc in
-   match wrapper.state with
--    | Busy_primitive ->
-+    | Busy_primitive | Waiting_for_busy ->
-         (* The channel is used, cancel auto flushing. It will be
-            restarted when the channel returns to the [Idle] state: *)
-         oc.auto_flushing <- false;
-@@ -287,9 +290,12 @@ let auto_flush oc =
- 
- let unlock wrapper = match wrapper.state with
-   | Busy_primitive | Busy_atomic _ ->
--      wrapper.state <- Idle;
--      if not (Lwt_sequence.is_empty wrapper.queued) then
--        wakeup_later (Lwt_sequence.take_l wrapper.queued) ();
-+      if Lwt_sequence.is_empty wrapper.queued then
-+        wrapper.state <- Idle
-+      else begin
-+        wrapper.state <- Waiting_for_busy;
-+        wakeup_later (Lwt_sequence.take_l wrapper.queued) ()
-+      end;
-       (* Launches the auto-flusher: *)
-       let ch = wrapper.channel in
-       if (* Launch the auto-flusher only if the channel is not busy: *)
-@@ -309,7 +315,7 @@ let unlock wrapper = match wrapper.state with
-       if not (Lwt_sequence.is_empty wrapper.queued) then
-         wakeup_later (Lwt_sequence.take_l wrapper.queued) ()
- 
--  | Idle ->
-+  | Idle | Waiting_for_busy ->
-       (* We must never unlock an unlocked channel *)
-       assert false
- 
-@@ -323,7 +329,7 @@ let primitive f wrapper = match wrapper.state with
-         unlock wrapper;
-         return ()
- 
--  | Busy_primitive | Busy_atomic _ ->
-+  | Busy_primitive | Busy_atomic _ | Waiting_for_busy ->
-       let (res, w) = task () in
-       let node = Lwt_sequence.add_r w wrapper.queued in
-       Lwt.on_cancel res (fun _ -> Lwt_sequence.remove node);
-@@ -334,7 +340,7 @@ let primitive f wrapper = match wrapper.state with
-             unlock wrapper;
-             raise_lwt (closed_channel wrapper.channel)
- 
--        | Idle ->
-+        | Idle | Waiting_for_busy ->
-             wrapper.state <- Busy_primitive;
-             try_lwt
-               f wrapper.channel
-@@ -370,7 +376,7 @@ let atomic f wrapper = match wrapper.state with
-         unlock wrapper;
-         return ()
- 
--  | Busy_primitive | Busy_atomic _ ->
-+  | Busy_primitive | Busy_atomic _ | Waiting_for_busy ->
-       let (res, w) = task () in
-       let node = Lwt_sequence.add_r w wrapper.queued in
-       Lwt.on_cancel res (fun _ -> Lwt_sequence.remove node);
-@@ -381,7 +387,7 @@ let atomic f wrapper = match wrapper.state with
-             unlock wrapper;
-             raise_lwt (closed_channel wrapper.channel)
- 
--        | Idle ->
-+        | Idle | Waiting_for_busy ->
-             let tmp_wrapper = { state = Idle;
-                                 channel = wrapper.channel;
-                                 queued = Lwt_sequence.create () } in
-@@ -415,7 +421,7 @@ let rec abort wrapper = match wrapper.state with
-       Lazy.force wrapper.channel.close
-   | Invalid ->
-       raise_lwt (invalid_channel wrapper.channel)
--  | Idle | Busy_primitive ->
-+  | Idle | Busy_primitive | Waiting_for_busy ->
-       wrapper.state <- Closed;
-       (* Abort any current real reading/writing operation on the
-          channel: *)
--- 
diff --git a/debian/patches/0003-fix-data-corruption-in-Lwt_io.patch b/debian/patches/0003-fix-data-corruption-in-Lwt_io.patch
deleted file mode 100644
index 041d278..0000000
--- a/debian/patches/0003-fix-data-corruption-in-Lwt_io.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Pierre Chambart <chambart at crans.org>
-Date: Thu, 28 Jul 2011 13:25:03 +0200
-Subject: fix data corruption in Lwt_io.
-
-Origin: http://ocsigen.org/darcsweb/?r=lwt;a=commit;h=20110728095212-0cb73-a111bbba9fba3d4be6c0585ff823c41417f02570.gz
----
- src/unix/lwt_unix_stubs.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/unix/lwt_unix_stubs.c b/src/unix/lwt_unix_stubs.c
-index e40196c..1adbaea 100644
---- a/src/unix/lwt_unix_stubs.c
-+++ b/src/unix/lwt_unix_stubs.c
-@@ -126,7 +126,7 @@ void lwt_unix_not_available(char const *feature)
- 
- CAMLprim value lwt_unix_blit_bytes_bytes(value val_buf1, value val_ofs1, value val_buf2, value val_ofs2, value val_len)
- {
--  memcpy((char*)Caml_ba_data_val(val_buf2) + Long_val(val_ofs2),
-+  memmove((char*)Caml_ba_data_val(val_buf2) + Long_val(val_ofs2),
-          (char*)Caml_ba_data_val(val_buf1) + Long_val(val_ofs1),
-          Long_val(val_len));
-   return Val_unit;
--- 
diff --git a/debian/patches/series b/debian/patches/series
index 3261106..97db22b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1 @@
 0001-Do-not-build-manual-manual.pdf.patch
-0002-fix-a-race-condition-in-Lwt_io.patch
-0003-fix-data-corruption-in-Lwt_io.patch

-- 
Cooperative light-weight thread library for OCaml



More information about the Pkg-ocaml-maint-commits mailing list