syncx

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package syncx holds the one synchronization primitive this repository cannot take from the standard library on every compiler.

TinyGo's sync.RWMutex (through at least 0.42) deadlocks whenever a reader arrives while a writer is waiting for the existing readers to drain: the new reader adds itself to the reader count before it blocks, so the count never returns to the value the writer is waiting for, and the reader in turn waits for the writer's Unlock. Upstream fix: tinygo-org/tinygo#5630.

RWMutex here is sync.RWMutex on standard Go and a plain sync.Mutex behind the same method set on the TinyGo path. Every critical section in this repository that used to sit under an RWMutex is a map lookup, so giving up reader parallelism costs nothing measurable, and a Mutex cannot hit the defect. Retire the shim when a TinyGo release ships the upstream fix; TestUpstreamRWMutexStillDeadlocks fails the day that happens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex

type RWMutex = sync.RWMutex

RWMutex is the standard library's on standard Go, where it is correct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL