Skip to content

Commit

Permalink
channels: permit usage with --mm:atomicArc (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoomRmc authored May 2, 2024
1 parent 8a1acc4 commit 11b315f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions threading/channels.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
##
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 11b315f

Please sign in to comment.