浏览代码

lib/nat: Avoid concurrent reset of NAT timer (fixes #3337)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3341
Jakob Borg 9 年之前
父节点
当前提交
a2dcffcca2
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      lib/nat/service.go

+ 1 - 2
lib/nat/service.go

@@ -44,9 +44,8 @@ func NewService(id protocol.DeviceID, cfg *config.Wrapper) *Service {
 func (s *Service) Serve() {
 	announce := stdsync.Once{}
 
-	s.timer.Reset(0)
-
 	s.mut.Lock()
+	s.timer.Reset(0)
 	s.stop = make(chan struct{})
 	s.mut.Unlock()