mirror of
https://github.com/Kong/go-pluginserver.git
synced 2025-10-05 08:06:58 +08:00
fix(*) pass pointers to share lock
Also lock the plugin when doing symbol lookup.
This commit is contained in:

committed by
Guilherme Salazar

parent
bff605d63c
commit
b59c19779f
@@ -93,7 +93,7 @@ func (s *PluginServer) StartInstance(config PluginConfig, status *InstanceStatus
|
||||
// InstanceStatus returns a given resource's status (the same given when started)
|
||||
//
|
||||
// RPC exported method
|
||||
func (s PluginServer) InstanceStatus(id int, status *InstanceStatus) error {
|
||||
func (s *PluginServer) InstanceStatus(id int, status *InstanceStatus) error {
|
||||
s.lock.RLock()
|
||||
instance, ok := s.instances[id]
|
||||
s.lock.RUnlock()
|
||||
@@ -117,7 +117,7 @@ func (s PluginServer) InstanceStatus(id int, status *InstanceStatus) error {
|
||||
// Returns the status just before closing.
|
||||
//
|
||||
// RPC exported method
|
||||
func (s PluginServer) CloseInstance(id int, status *InstanceStatus) error {
|
||||
func (s *PluginServer) CloseInstance(id int, status *InstanceStatus) error {
|
||||
s.lock.RLock()
|
||||
instance, ok := s.instances[id]
|
||||
s.lock.RUnlock()
|
||||
|
Reference in New Issue
Block a user