mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 06:25: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
|
sdkContext *sdk.Context
|
||||||
contextMutex sync.Mutex
|
contextMutex sync.Mutex
|
||||||
isTerminated bool
|
isTerminated bool
|
||||||
terminationMutex sync.Mutex
|
terminationMutex sync.RWMutex
|
||||||
maxRetries time.Duration
|
maxRetries time.Duration
|
||||||
lostConnection bool
|
lostConnection bool
|
||||||
lostConnectionMutex sync.Mutex
|
lostConnectionMutex sync.Mutex
|
||||||
@ -43,9 +43,9 @@ func (mms *MqttMonitor) Terminate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mms *MqttMonitor) IsTerminated() (isTerminated bool) {
|
func (mms *MqttMonitor) IsTerminated() (isTerminated bool) {
|
||||||
mms.terminationMutex.Lock()
|
mms.terminationMutex.RLock()
|
||||||
isTerminated = mms.isTerminated
|
isTerminated = mms.isTerminated
|
||||||
mms.terminationMutex.Unlock()
|
mms.terminationMutex.RUnlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user