dblock

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dblock exposes the SQLite-compatible byte-range lock used by Replica.applyLTXFile. External callers that mirror the LTX apply pipeline (e.g. shard-layer standby readers) take the same lock so they interlock with SQLite's own locking and with each other.

The pending-byte + shared-region ranges are SQLite-internal addresses (sqlitePendingByte=0x40000000); locking those bytes blocks any SQLite reader/writer process that opens the same file, matching the granularity used by replicate's internal applyLTXFile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LockExclusive

func LockExclusive(f *os.File) error

LockExclusive acquires the SQLite-compatible exclusive lock on f. Returns an error if the lock cannot be acquired (already held by another process, fd is invalid, etc).

func Unlock

func Unlock(f *os.File) error

Unlock releases the exclusive lock acquired by LockExclusive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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