simplify usage of mutexes and atomic constants (#9501)

This commit is contained in:
Harshavardhana
2020-05-03 22:35:40 -07:00
committed by GitHub
parent fbd15cb7b7
commit 27d716c663
18 changed files with 419 additions and 305 deletions

View File

@@ -42,7 +42,7 @@ const (
)
// Global object layer mutex, used for safely updating object layer.
var globalObjLayerMutex *sync.RWMutex
var globalObjLayerMutex sync.RWMutex
// Global object layer, only accessed by globalObjectAPI.
var globalObjectAPI ObjectLayer
@@ -50,11 +50,6 @@ var globalObjectAPI ObjectLayer
//Global cacheObjects, only accessed by newCacheObjectsFn().
var globalCacheObjectAPI CacheObjectLayer
func init() {
// Initialize this once per server initialization.
globalObjLayerMutex = &sync.RWMutex{}
}
// Checks if the object is a directory, this logic uses
// if size == 0 and object ends with SlashSeparator then
// returns true.