mirror of
https://github.com/syncthing/notify.git
synced 2026-06-07 08:57:32 +00:00
The Unwatch method on Windows is asynchronous. Thus when calling Watch, Unwatch and Watch on the same path the Unwatch state may happen after the second Watch call. This means that second Watch will be skipped as already created. This commit makes second Watch call invalidate Unwatch state. So Watch->Unwatch->Watch will be basically a no-op. This doesn't solve all the problems since the second Watch might have different events to handle. However, this should be solved by using Rewatch method. Also, the code fixes a data race that may occur when invalidating grip handle. Fixes: #150
10 lines
224 B
Go
10 lines
224 B
Go
// Copyright (c) 2014-2018 The Notify Authors. All rights reserved.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// +build !debug
|
|
|
|
package notify
|
|
|
|
var debugTag = false
|