projects
/
platform
/
core
/
system
/
edge-orchestration.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
572b74d
)
discoverymgr/discovery_setTXT.go : add mutex for shared resource serverTXT
72/203372/1
author
damon92
<damon92.lee@samsung.com>
Fri, 12 Apr 2019 06:39:58 +0000
(15:39 +0900)
committer
damon92
<damon92.lee@samsung.com>
Fri, 12 Apr 2019 06:41:56 +0000
(15:41 +0900)
Change-Id: If0ec6997711b5a597c09437688f2e38ae9eb3ff1
src/discoverymgr/discovery_setTXT.go
patch
|
blob
|
history
diff --git
a/src/discoverymgr/discovery_setTXT.go
b/src/discoverymgr/discovery_setTXT.go
index
2867993
..
cc0cbe5
100755
(executable)
--- a/
src/discoverymgr/discovery_setTXT.go
+++ b/
src/discoverymgr/discovery_setTXT.go
@@
-18,11
+18,12
@@
package discoverymgr
import (
"errors"
-
+ "sync"
confdescription "configuremgr/description"
)
var serverTXT []string
+var serverTXTmtx sync.Mutex
//ResetServiceName will reset txt of mdns message
func ResetServiceName() error {
@@
-45,6
+46,8
@@
func AddNewServiceName(doc *confdescription.Doc) error {
//SetServiceNames set txt of mdns message
func SetServiceNames(newService string) error {
+ serverTXTmtx.Lock()
+ defer serverTXTmtx.Unlock()
if newService == "" {
if gServer != nil {