From b47285f1cf0cb475f29322ceb9fac4d7e1cfb11f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 3 Jan 2018 15:50:33 +0100 Subject: vendor: update github.com/rjeczalik/notify (#15801) --- vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/rjeczalik') diff --git a/vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go b/vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go index fb70de6af..2248a1b12 100644 --- a/vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go +++ b/vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go @@ -26,9 +26,9 @@ import "C" import ( "errors" "os" + "runtime" "sync" "sync/atomic" - "time" "unsafe" ) @@ -63,6 +63,10 @@ var ( func init() { wg.Add(1) go func() { + // There is exactly one run loop per thread. Lock this goroutine to its + // thread to ensure that it's not rescheduled on a different thread while + // setting up the run loop. + runtime.LockOSThread() runloop = C.CFRunLoopGetCurrent() C.CFRunLoopAddSource(runloop, source, C.kCFRunLoopDefaultMode) C.CFRunLoopRun() @@ -73,7 +77,6 @@ func init() { //export gosource func gosource(unsafe.Pointer) { - time.Sleep(time.Second) wg.Done() } -- cgit v1.2.3