2014-05-13 01:00:11 -06:00
|
|
|
// Copyright 2013 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2014-05-20 19:45:47 -06:00
|
|
|
// +build nacl plan9 solaris
|
2014-05-13 01:00:11 -06:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"sync"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FileMutex is similar to sync.RWMutex, but also synchronizes across processes.
|
|
|
|
// This implementation is a fallback that does not actually provide inter-process synchronization.
|
|
|
|
type FileMutex struct {
|
|
|
|
sync.RWMutex
|
|
|
|
}
|
|
|
|
|
|
|
|
func MakeFileMutex(filename string) *FileMutex {
|
|
|
|
return &FileMutex{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
log.Printf("WARNING: using fake file mutex." +
|
|
|
|
" Don't run more than one of these at once!!!")
|
|
|
|
}
|