pike.git / lib / modules / Filesystem.pmod / Monitor.pmod / basic.pike

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:816: Inside #if HAVE_EVENTSTREAM
   protected void register_path(int|void initial)    {    if (backend) {    // CFRunLoop only works with the primary backend.    ::register_path(initial);    return;    }   #ifndef INHIBIT_EVENTSTREAM_MONITOR    if (!initial) return;    +  if (Pike.DefaultBackend.executing_thread() != Thread.this_thread()) { +  // eventstream stuff (especially start()) must be called from +  // the backend thread, otherwise events will be fired in +  // CFRunLoop contexts where noone listens. +  call_out (register_path, 0, initial); +  return; +  } +     if (!eventstream) {    // Make sure that the main backend is in CF-mode.    Pike.DefaultBackend.enable_core_foundation(1);       MON_WERR("Creating event stream.\n");   #if constant (System.FSEvents.kFSEventStreamCreateFlagFileEvents)    int flags = System.FSEvents.kFSEventStreamCreateFlagFileEvents;   #else    int flags = System.FSEvents.kFSEventStreamCreateFlagNone;   #endif