MCPcopy Index your code
hub / github.com/alexflint/go-filemutex

github.com/alexflint/go-filemutex @v1.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.0 ↗ · + Follow
25 symbols 86 edges 4 files 4 documented · 16% 9 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FileMutex

FileMutex is similar to sync.RWMutex, but also synchronizes across processes. On Linux, OSX, and other POSIX systems it uses the flock system call. On windows it uses the LockFileEx and UnlockFileEx system calls.

import (
    "log"
    "github.com/alexflint/go-filemutex"
)

func main() {
    m, err := filemutex.New("/tmp/foo.lock")
    if err != nil {
        log.Fatalln("Directory did not exist or file could not created")
    }

    m.Lock()  // Will block until lock can be acquired

    // Code here is protected by the mutex

    m.Unlock()
}

Installation

go get github.com/alexflint/go-filemutex

Forked from https://github.com/golang/build/tree/master/cmd/builder/filemutex_*.go

Core symbols most depended-on inside this repo

Shape

Method 12
Function 11
Struct 2

Languages

Go100%

Modules by API surface

filemutex_test.go9 symbols
filemutex_windows.go8 symbols
filemutex_flock.go8 symbols

For agents

$ claude mcp add go-filemutex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page