mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 14:35:47 +00:00
termintationMutex became a sync.RWMutex
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
a92fc79cd2
commit
8f379980e9
@ -28,7 +28,7 @@ type MqttMonitor struct {
|
||||
sdkContext *sdk.Context
|
||||
contextMutex sync.Mutex
|
||||
isTerminated bool
|
||||
terminationMutex sync.Mutex
|
||||
terminationMutex sync.RWMutex
|
||||
maxRetries time.Duration
|
||||
lostConnection bool
|
||||
lostConnectionMutex sync.Mutex
|
||||
@ -43,9 +43,9 @@ func (mms *MqttMonitor) Terminate() {
|
||||
}
|
||||
|
||||
func (mms *MqttMonitor) IsTerminated() (isTerminated bool) {
|
||||
mms.terminationMutex.Lock()
|
||||
mms.terminationMutex.RLock()
|
||||
isTerminated = mms.isTerminated
|
||||
mms.terminationMutex.Unlock()
|
||||
mms.terminationMutex.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user