Branch: Tag:

2015-12-10

2015-12-10 15:08:57 by Martin Karlgren <marty@roxen.com>

Filesystem.Monitor: Always perform EventStream operations from the backend thread.

Paths added from a non-backend thread would not trigger any events, because
only the backend thread monitors its CFRunLoop event stuff.

823: Inside #if HAVE_EVENTSTREAM and #if undefined(INHIBIT_EVENTSTREAM_MONITOR)
  #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);