Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions default_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewDefaultHandler() *defaultHandler {
}

type defaultHandler struct {
sync.RWMutex
mu sync.RWMutex
objects map[ObjectPath]*exportedObj
defaultIntf map[string]*exportedIntf
}
Expand Down Expand Up @@ -65,8 +65,8 @@ func (h *defaultHandler) introspectPath(path ObjectPath) string {
}

func (h *defaultHandler) LookupObject(path ObjectPath) (ServerObject, bool) {
h.RLock()
defer h.RUnlock()
h.mu.RLock()
defer h.mu.RUnlock()
object, ok := h.objects[path]
if ok {
return object, ok
Expand Down Expand Up @@ -102,15 +102,15 @@ func (h *defaultHandler) LookupObject(path ObjectPath) (ServerObject, bool) {
}

func (h *defaultHandler) AddObject(path ObjectPath, object *exportedObj) {
h.Lock()
h.mu.Lock()
h.objects[path] = object
h.Unlock()
h.mu.Unlock()
}

func (h *defaultHandler) DeleteObject(path ObjectPath) {
h.Lock()
h.mu.Lock()
delete(h.objects, path)
h.Unlock()
h.mu.Unlock()
}

type exportedMethod struct {
Expand Down