From 61887100ae8efdad235ab25e3fa5b2da7598104e Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 28 Jun 2023 11:46:24 -0400 Subject: [PATCH] deprecate containers.thread --- containers-thread.opam | 2 +- src/core/CCInt.ml | 2 +- src/threads/CCBlockingQueue.mli | 3 +++ src/threads/CCLock.mli | 3 +++ src/threads/CCPool.mli | 3 +++ src/threads/CCSemaphore.mli | 2 ++ src/threads/CCThread.mli | 3 +++ src/threads/CCTimer.mli | 3 +++ src/threads/dune | 2 ++ 9 files changed, 21 insertions(+), 2 deletions(-) diff --git a/containers-thread.opam b/containers-thread.opam index 79ea3867..fb21ef4e 100644 --- a/containers-thread.opam +++ b/containers-thread.opam @@ -3,7 +3,7 @@ version: "3.12" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" -synopsis: "An extension of containers for threading" +synopsis: "An extension of containers for threading. DEPRECATED: use moonpool, domainslib, etc." build: [ ["dune" "build" "-p" name "-j" jobs] ["dune" "build" "@doc" "-p" name ] {with-doc} diff --git a/src/core/CCInt.ml b/src/core/CCInt.ml index 52cf5d1d..a2efe7bc 100644 --- a/src/core/CCInt.ml +++ b/src/core/CCInt.ml @@ -32,8 +32,8 @@ let hash (n : int) : int = (* h := h xor (k-th byte of n) *) h := Int64.(logxor !h (of_int ((n lsr (k * 8)) land 0xff))) done; + (* truncate back to int and remove sign *) Int64.to_int !h land max_int -(* truncate back to int and remove sign *) let range i j yield = let rec up i j yield = diff --git a/src/threads/CCBlockingQueue.mli b/src/threads/CCBlockingQueue.mli index 228d4180..a043e763 100644 --- a/src/threads/CCBlockingQueue.mli +++ b/src/threads/CCBlockingQueue.mli @@ -7,6 +7,9 @@ @since 0.16 *) +[@@@deprecated +"use moonpool or domainslib or saturn, libraries designed for multicore"] + type 'a t (** Safe-thread queue for values of type ['a] *) diff --git a/src/threads/CCLock.mli b/src/threads/CCLock.mli index 0c84b5d6..9fcc5c6b 100644 --- a/src/threads/CCLock.mli +++ b/src/threads/CCLock.mli @@ -6,6 +6,9 @@ @since 0.8 *) +[@@@deprecated +"use moonpool or domainslib or saturn, libraries designed for multicore"] + type 'a t (** A value surrounded with a lock *) diff --git a/src/threads/CCPool.mli b/src/threads/CCPool.mli index 1987c011..ad159480 100644 --- a/src/threads/CCPool.mli +++ b/src/threads/CCPool.mli @@ -5,6 +5,9 @@ Renamed and heavily updated from [CCFuture]. @since 0.16 *) +[@@@deprecated +"use moonpool or domainslib or saturn, libraries designed for multicore"] + type +'a state = Done of 'a | Waiting | Failed of exn module type PARAM = sig diff --git a/src/threads/CCSemaphore.mli b/src/threads/CCSemaphore.mli index dcf66e29..27e6abb4 100644 --- a/src/threads/CCSemaphore.mli +++ b/src/threads/CCSemaphore.mli @@ -4,6 +4,8 @@ @since 0.13 *) +[@@@deprecated "use the stdlib's Semaphore module"] + type t (** A semaphore *) diff --git a/src/threads/CCThread.mli b/src/threads/CCThread.mli index a8240fed..08965ce8 100644 --- a/src/threads/CCThread.mli +++ b/src/threads/CCThread.mli @@ -5,6 +5,9 @@ {b status: unstable} @since 0.13 *) +[@@@deprecated +"use moonpool or domainslib or saturn, libraries designed for multicore"] + type t = Thread.t val spawn : (unit -> _) -> t diff --git a/src/threads/CCTimer.mli b/src/threads/CCTimer.mli index e114ca45..0ef4d131 100644 --- a/src/threads/CCTimer.mli +++ b/src/threads/CCTimer.mli @@ -3,6 +3,9 @@ Used to be part of [CCFuture]. @since 0.16 *) +[@@@deprecated +"use moonpool or domainslib or saturn, libraries designed for multicore"] + type t (** A scheduler for events. It runs in its own thread. *) diff --git a/src/threads/dune b/src/threads/dune index 649a4a5f..0aafb8ed 100644 --- a/src/threads/dune +++ b/src/threads/dune @@ -1,6 +1,7 @@ (library (name containers_thread) (public_name containers-thread) + (synopsis "DEPRECATED library for threading") (wrapped false) (optional) (flags :standard -warn-error -a+8 -w -32 -safe-string) @@ -8,3 +9,4 @@ (action (run %{project_root}/src/core/cpp/cpp.exe %{input-file}))) (libraries containers threads)) +