| 116 | } |
| 117 | |
| 118 | void start(u32 num, const char **paths, bool recursive, FileMonitorFunction fmf, void *user_data) |
| 119 | { |
| 120 | CE_ENSURE(NULL != fmf); |
| 121 | |
| 122 | _recursive = recursive; |
| 123 | _function = fmf; |
| 124 | _user_data = user_data; |
| 125 | |
| 126 | _fd = inotify_init(); |
| 127 | |
| 128 | if (_fd == -1) |
| 129 | return; |
| 130 | |
| 131 | for (u32 i = 0; i < num; ++i) |
| 132 | add_watch(paths[i], recursive); |
| 133 | |
| 134 | _thread.start([](void *thiz) { return static_cast<FileMonitorImpl *>(thiz)->watch(); }, this); |
| 135 | } |
| 136 | |
| 137 | void stop() |
| 138 | { |