func (l *RWLockStruct) TryWriteLock() (err error) {
	err = l.commonLock(exclusive, true)
	return err
}
TryWriteLock() attempts to grab the lock if is is free.  Otherwise, it returns EAGAIN.
package dlm
import (
	"fmt"
	"github.com/NVIDIA/proxyfs/trackedlock"
)
type NotifyReason uint32
type CallerID *string
const (
	ReasonWriteRequest NotifyReason = iota + 1  
	ReasonReadRequest                           
)
type LockHeldType uint32
const (
	ANYLOCK LockHeldType = iota + 1
	READLOCK
	WRITELOCK
)
type Notify interface {
	NotifyNodeChange(reason NotifyReason)  
}
type RWLockStruct struct {
	LockID       string
	Notify       Notify
	LockCallerID CallerID
}
var callerIDLock trackedlock.Mutex
var nextCallerID uint64 = 1000
func GenerateCallerID() (callerID CallerID) {
	callerIDLock.Lock()
	callerIDStr := fmt.Sprintf("%d", nextCallerID)
	callerID = CallerID(&callerIDStr)
	nextCallerID++
	callerIDLock.Unlock()
	return callerID
}
func IsLockHeld(lockID string, callerID CallerID, lockHeldType LockHeldType) (held bool) {
	held = isLockHeld(lockID, callerID, lockHeldType)
	return held
}
func (l *RWLockStruct) GetLockID() string {
	return l.LockID
}
func (l *RWLockStruct) GetCallerID() CallerID {
	return l.LockCallerID
}
func (l *RWLockStruct) IsReadHeld() bool {
	held := isLockHeld(l.LockID, l.LockCallerID, READLOCK)
	return held
}
func (l *RWLockStruct) IsWriteHeld() bool {
	held := isLockHeld(l.LockID, l.LockCallerID, WRITELOCK)
	return held
}
func (l *RWLockStruct) WriteLock() (err error) {
	err = l.commonLock(exclusive, false)
	return err
}
func (l *RWLockStruct) ReadLock() (err error) {
	err = l.commonLock(shared, false)
	return err
}