github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/dashboard/builder/filemutex_local.go (about)

     1  // Copyright 2013 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build nacl plan9 solaris
     6  
     7  package main
     8  
     9  import (
    10  	"log"
    11  	"sync"
    12  )
    13  
    14  // FileMutex is similar to sync.RWMutex, but also synchronizes across processes.
    15  // This implementation is a fallback that does not actually provide inter-process synchronization.
    16  type FileMutex struct {
    17  	sync.RWMutex
    18  }
    19  
    20  func MakeFileMutex(filename string) *FileMutex {
    21  	return &FileMutex{}
    22  }
    23  
    24  func init() {
    25  	log.Printf("WARNING: using fake file mutex." +
    26  		" Don't run more than one of these at once!!!")
    27  }