Skip to content

feat: basic implementation#1

Merged
George-Miao merged 2 commits into
mainfrom
feat/all
Jan 5, 2026
Merged

feat: basic implementation#1
George-Miao merged 2 commits into
mainfrom
feat/all

Conversation

@George-Miao
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the foundational structure for the synchrony library, which provides both synchronous (multithreaded) and asynchronous (single-threaded) versions of common synchronization primitives. The implementation uses a clever pattern where primitives are organized into sync and unsync modules, allowing library authors to easily switch between multithreaded and single-threaded implementations based on feature flags.

Key changes include:

  • Implementation of core synchronization primitives (Mutex, BiLock, AtomicTypes, WakerSlot, Event, Flag)
  • Module structure with sync/unsync variants using macros for code generation
  • Development tooling setup (CI workflows, formatting, commit linting)

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/lib.rs Main library entry point with module exports and usage examples
src/waker_slot.rs Waker slot implementation for task wakeup in both sync and unsync variants
src/shared.rs Type aliases for shared pointers (Arc/Rc)
src/mutex_blocking.rs Blocking mutex wrappers for both sync and unsync variants
src/mutex/mod.rs Async mutex implementation using macros to generate sync/unsync versions
src/mutex/unsync.rs Tests for mutex guard debug formatting
src/flag.rs Boolean flag abstraction with atomic operations
src/event.rs Event notification primitives wrapping external libraries
src/bilock/mod.rs BiLock (two-party lock) implementation
src/atomic/mod.rs Atomic scalar type re-exports and module definitions
src/atomic/unsync.rs Single-threaded atomic type implementations using Cell
Cargo.toml Package metadata, dependencies, and feature flags
README.md Library documentation and feature list
.gitignore Git ignore patterns for build artifacts and editor files
.envrc Direnv configuration file
.direnv/bin/nix-direnv-reload Auto-generated direnv script with hardcoded paths
rustfmt.toml Code formatting configuration
flake.nix Nix development environment configuration
flake.lock Nix flake lock file
.github/workflows/* CI workflow definitions for formatting, linting, and checking
.github/dependabot.yml Dependabot configuration
.commitlintrc.json Commit message linting configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread src/lib.rs
Comment thread src/lib.rs Outdated
Comment thread .envrc Outdated
Comment thread src/waker_slot.rs Outdated
Comment thread src/waker_slot.rs Outdated
Comment thread src/waker_slot.rs
Comment thread src/mutex_blocking.rs Outdated
Comment thread src/atomic/unsync.rs Outdated
@compio-rs compio-rs deleted a comment from Copilot AI Jan 5, 2026
Copy link
Copy Markdown
Member

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we should add tests for the sync types to make sure that they are Send + Sync. Maybe a next PR.

@George-Miao
Copy link
Copy Markdown
Member Author

LGTM. I think we should add tests for the sync types to make sure that they are Send + Sync. Maybe a next PR.

Yeah sounds good.

@George-Miao George-Miao merged commit 4518a88 into main Jan 5, 2026
2 checks passed
@George-Miao George-Miao deleted the feat/all branch January 5, 2026 16:11
Comment thread src/atomic/unsync.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants