mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Added distributed RWMutex (#2369)
This commit is contained in:
parent
e55926e8cf
commit
3939c75345
@ -18,6 +18,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/minio/dsync"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@ -29,7 +30,7 @@ type nsParam struct {
|
||||
|
||||
// nsLock - provides primitives for locking critical namespace regions.
|
||||
type nsLock struct {
|
||||
sync.RWMutex
|
||||
*dsync.DRWMutex
|
||||
ref uint
|
||||
}
|
||||
|
||||
@ -58,7 +59,8 @@ func (n *nsLockMap) lock(volume, path string, readLock bool) {
|
||||
nsLk, found := n.lockMap[param]
|
||||
if !found {
|
||||
nsLk = &nsLock{
|
||||
ref: 0,
|
||||
DRWMutex: dsync.NewDRWMutex(volume + path),
|
||||
ref: 0,
|
||||
}
|
||||
n.lockMap[param] = nsLk
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user