deprecate containers.thread

This commit is contained in:
Simon Cruanes 2023-06-28 11:46:24 -04:00
parent ad10cdc9d5
commit 61887100ae
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
9 changed files with 21 additions and 2 deletions

View file

@ -3,7 +3,7 @@ version: "3.12"
author: "Simon Cruanes" author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org" maintainer: "simon.cruanes.2007@m4x.org"
license: "BSD-2-Clause" license: "BSD-2-Clause"
synopsis: "An extension of containers for threading" synopsis: "An extension of containers for threading. DEPRECATED: use moonpool, domainslib, etc."
build: [ build: [
["dune" "build" "-p" name "-j" jobs] ["dune" "build" "-p" name "-j" jobs]
["dune" "build" "@doc" "-p" name ] {with-doc} ["dune" "build" "@doc" "-p" name ] {with-doc}

View file

@ -32,8 +32,8 @@ let hash (n : int) : int =
(* h := h xor (k-th byte of n) *) (* h := h xor (k-th byte of n) *)
h := Int64.(logxor !h (of_int ((n lsr (k * 8)) land 0xff))) h := Int64.(logxor !h (of_int ((n lsr (k * 8)) land 0xff)))
done; done;
Int64.to_int !h land max_int
(* truncate back to int and remove sign *) (* truncate back to int and remove sign *)
Int64.to_int !h land max_int
let range i j yield = let range i j yield =
let rec up i j yield = let rec up i j yield =

View file

@ -7,6 +7,9 @@
@since 0.16 *) @since 0.16 *)
[@@@deprecated
"use moonpool or domainslib or saturn, libraries designed for multicore"]
type 'a t type 'a t
(** Safe-thread queue for values of type ['a] *) (** Safe-thread queue for values of type ['a] *)

View file

@ -6,6 +6,9 @@
@since 0.8 *) @since 0.8 *)
[@@@deprecated
"use moonpool or domainslib or saturn, libraries designed for multicore"]
type 'a t type 'a t
(** A value surrounded with a lock *) (** A value surrounded with a lock *)

View file

@ -5,6 +5,9 @@
Renamed and heavily updated from [CCFuture]. Renamed and heavily updated from [CCFuture].
@since 0.16 *) @since 0.16 *)
[@@@deprecated
"use moonpool or domainslib or saturn, libraries designed for multicore"]
type +'a state = Done of 'a | Waiting | Failed of exn type +'a state = Done of 'a | Waiting | Failed of exn
module type PARAM = sig module type PARAM = sig

View file

@ -4,6 +4,8 @@
@since 0.13 *) @since 0.13 *)
[@@@deprecated "use the stdlib's Semaphore module"]
type t type t
(** A semaphore *) (** A semaphore *)

View file

@ -5,6 +5,9 @@
{b status: unstable} {b status: unstable}
@since 0.13 *) @since 0.13 *)
[@@@deprecated
"use moonpool or domainslib or saturn, libraries designed for multicore"]
type t = Thread.t type t = Thread.t
val spawn : (unit -> _) -> t val spawn : (unit -> _) -> t

View file

@ -3,6 +3,9 @@
Used to be part of [CCFuture]. Used to be part of [CCFuture].
@since 0.16 *) @since 0.16 *)
[@@@deprecated
"use moonpool or domainslib or saturn, libraries designed for multicore"]
type t type t
(** A scheduler for events. It runs in its own thread. *) (** A scheduler for events. It runs in its own thread. *)

View file

@ -1,6 +1,7 @@
(library (library
(name containers_thread) (name containers_thread)
(public_name containers-thread) (public_name containers-thread)
(synopsis "DEPRECATED library for threading")
(wrapped false) (wrapped false)
(optional) (optional)
(flags :standard -warn-error -a+8 -w -32 -safe-string) (flags :standard -warn-error -a+8 -w -32 -safe-string)
@ -8,3 +9,4 @@
(action (action
(run %{project_root}/src/core/cpp/cpp.exe %{input-file}))) (run %{project_root}/src/core/cpp/cpp.exe %{input-file})))
(libraries containers threads)) (libraries containers threads))