From 6d3b887e77082980a2a19faf2a0912c67083509b Mon Sep 17 00:00:00 2001 From: Zoom Date: Thu, 2 May 2024 15:53:31 +0400 Subject: [PATCH] channels: permit usage with `--mm:atomicArc` --- readme.md | 2 +- threading/channels.nim | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index ef70b0f..98167fa 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ New threading primitives for Nim's `arc`/`orc` memory management modes: atomics, ## Documentation -> These modules require `--mm:arc` or `--mm:orc`! +> These modules require `--threads:on`, and one of the `--mm:arc`, `--mm:orc` or `--mm:atomicArc` compilation flags! Documentation: https://nim-lang.github.io/threading diff --git a/threading/channels.nim b/threading/channels.nim index 32b9576..c7697ad 100644 --- a/threading/channels.nim +++ b/threading/channels.nim @@ -14,7 +14,8 @@ # .. [1] https://github.com/mratsim/weave/blob/5696d94e6358711e840f8c0b7c684fcc5cbd4472/unused/channels/channels_legacy.nim # .. [2] https://github.com/aprell/tasking-2.0/blob/master/src/channel_shm/channel.c -## This module only works with `--gc:arc` or `--gc:orc`. +## This module works only with one of `--mm:arc` / `--mm:atomicArc` / `--mm:orc` +## compilation flags. ## ## .. warning:: This module is experimental and its interface may change. ## @@ -96,8 +97,8 @@ runnableExamples("--threads:on --gc:orc"): # At least one non-successful attempt to receive the message had to occur. assert messages.len >= 2 -when not defined(gcArc) and not defined(gcOrc) and not defined(nimdoc): - {.error: "This channel implementation requires --gc:arc or --gc:orc".} +when not (defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc) or defined(nimdoc)): + {.error: "This module requires one of --mm:arc / --mm:atomicArc / --mm:orc compilation flags".} import std/[locks, isolation] import ./atomics