summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp7
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents_p.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index 3e0aee89c..cb276b795 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -422,9 +422,12 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef ,
void QFSEventsFileSystemWatcherEngine::stop()
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ QMutexLocker locker(&mutex);
stopFSStream(fsStream);
- if (threadsRunLoop)
+ if (threadsRunLoop) {
CFRunLoopStop(threadsRunLoop);
+ waitForStop.wait(&mutex);
+ }
#endif
}
@@ -461,6 +464,8 @@ void QFSEventsFileSystemWatcherEngine::run()
// immediately.
CFRunLoopRun();
threadsRunLoop = 0;
+ QMutexLocker locker(&mutex);
+ waitForStop.wakeAll();
#endif
}
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
index 477086725..ffc0c687f 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h
+++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
@@ -114,6 +114,7 @@ private:
CFRunLoopRef threadsRunLoop;
QMutex mutex;
QWaitCondition waitCondition;
+ QWaitCondition waitForStop;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
PathHash filePathInfoHash;
PathHash dirPathInfoHash;