Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channels: permit usage with --mm:atomicArc #63

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading