MCPcopy Create free account
hub / github.com/MG-RAST/Shock / NewNodeLock

Function NewNodeLock

shock-server/node/locker/locker.go:67–79  ·  view source on GitHub ↗

############## NodeLocker ##############

(id string)

Source from the content-addressed store, hash-verified

65// ############## NodeLocker ##############
66
67func NewNodeLock(id string) (n *NodeLock) {
68 if lockDebug {
69 fmt.Printf("locker.NewNodeLock gid=%d node=%s\n", getGID(), id)
70 }
71 n = &NodeLock{
72 Id: id,
73 IsLocked: false,
74 Updated: time.Now(),
75 writeLock: make(chan int, 1),
76 }
77 n.writeLock <- 1 // Put the initial value into the channel
78 return
79}
80
81type NodeLock struct {
82 Id string `bson:"-" json:"id"`

Callers 1

AddMethod · 0.85

Calls 1

getGIDFunction · 0.85

Tested by

no test coverage detected