1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

file: Remove index and dir mutexes

HashLock makes these redundant.  #77
This commit is contained in:
James Hillyerd
2018-03-18 13:58:47 -07:00
parent 5cb07d5780
commit 0d0e07da70
3 changed files with 2 additions and 26 deletions

View File

@@ -7,7 +7,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"sync"
"time"
"github.com/jhillyerd/inbucket/pkg/config"
@@ -21,15 +20,6 @@ import (
const indexFileName = "index.gob"
var (
// indexMx is locked while reading/writing an index file
//
// NOTE: This is a bottleneck because it's a single lock even if we have a
// million index files
indexMx = new(sync.RWMutex)
// dirMx is locked while creating/removing directories
dirMx = new(sync.Mutex)
// countChannel is filled with a sequential numbers (0000..9999), which are
// used by generateID() to generate unique message IDs. It's global
// because we only want one regardless of the number of DataStore objects