Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clerk ¶
type Clerk struct {
// contains filtered or unexported fields
}
the lockservice Clerk lives in the client and maintains a little state.
type DeafConn ¶
type DeafConn struct {
// contains filtered or unexported fields
}
hack to allow test_test.go to have primary process an RPC but not send a reply. can't use the shutdown() trick b/c that causes client to immediately get an error and send to backup before primary does. please don't change anything to do with DeafConn.
type LockArgs ¶
type LockArgs struct { // Go's net/rpc requires that these field // names start with upper case letters! Lockname string // lock name }
Lock(lockname) returns OK=true if the lock is not held. If it is held, it returns OK=false immediately.
type LockServer ¶
type LockServer struct {
// contains filtered or unexported fields
}
func StartServer ¶
func StartServer(primary string, backup string, am_primary bool) *LockServer
func (*LockServer) Lock ¶
func (ls *LockServer) Lock(args *LockArgs, reply *LockReply) error
server Lock RPC handler.
you will have to modify this function
func (*LockServer) Unlock ¶
func (ls *LockServer) Unlock(args *UnlockArgs, reply *UnlockReply) error
server Unlock RPC handler.
type UnlockArgs ¶
type UnlockArgs struct {
Lockname string
}
Unlock(lockname) returns OK=true if the lock was held. It returns OK=false if the lock was not held.
type UnlockReply ¶
type UnlockReply struct {
OK bool
}
Click to show internal directories.
Click to hide internal directories.