add an option to force the use of PollingDirectoryWatcherStrategy on Linux

This commit is contained in:
Ludovic LIEVRE 2020-01-10 09:54:19 +00:00
parent d36cc4aee8
commit 42629d1ed4
2 changed files with 6 additions and 3 deletions

View File

@ -104,7 +104,10 @@
// Define to disable compilation of DirectoryWatcher // Define to disable compilation of DirectoryWatcher
// on platforms with no inotify. // on platforms with no inotify.
// #define POCO_NO_INOTIFY //#define POCO_NO_INOTIFY
// Define to force the use of PollingDirectoryWatcher
#define POCO_DW_FORCE_POLLING
// Following are options to remove certain features // Following are options to remove certain features

View File

@ -252,7 +252,7 @@ private:
}; };
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID #elif (POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID) && !defined(POCO_DW_FORCE_POLLING)
class LinuxDirectoryWatcherStrategy: public DirectoryWatcherStrategy class LinuxDirectoryWatcherStrategy: public DirectoryWatcherStrategy
@ -572,7 +572,7 @@ void DirectoryWatcher::init()
#if POCO_OS == POCO_OS_WINDOWS_NT #if POCO_OS == POCO_OS_WINDOWS_NT
_pStrategy = new WindowsDirectoryWatcherStrategy(*this); _pStrategy = new WindowsDirectoryWatcherStrategy(*this);
#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID #elif (POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID) && !defined(POCO_DW_FORCE_POLLING)
_pStrategy = new LinuxDirectoryWatcherStrategy(*this); _pStrategy = new LinuxDirectoryWatcherStrategy(*this);
#elif POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD #elif POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_FREE_BSD
_pStrategy = new BSDDirectoryWatcherStrategy(*this); _pStrategy = new BSDDirectoryWatcherStrategy(*this);