Branch: Tag:

2012-07-04

2012-07-04 19:17:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Filesystem.Monitor: call_out mode now has some chance at working again.

1122:   //! Call-out identifier for @[backend_check()] if in   //! nonblocking mode.   //! + //! Set to @expr{1@} when non_blocking mode without call_outs + //! is in use. + //!   //! @seealso   //! @[set_nonblocking()], @[set_blocking()]   protected mixed co_id;
1163:   //! @[check()], @[set_nonblocking()]   protected void backend_check()   { -  co_id = 0; +  if (co_id != 1) co_id = 0;    int t;    mixed err = catch {    t = check(0);    }; - #if HAVE_EVENTSTREAM - // if we are using FSEvents, we don't want to run this check more than once to prime the pumps. - #elseif HAVE_INOTIFY - // if we are using Inotify, we don't want to run this check more than once to prime the pumps. - #else +     set_nonblocking(t); - #endif /* HAVE_EVENTSTREAM */ +     if (err) throw(err);   }   
1204:    if (t > max_dir_check_interval) t = max_dir_check_interval;    if (t < 0) t = 0;    } - // if (backend) co_id = backend->call_out(backend_check, t); - // else co_id = call_out(backend_check, t); + #if HAVE_EVENTSTREAM +  // If we are using FSEvents, we don't need any call_outs. +  co_id = 1; + #elseif HAVE_INOTIFY +  // If we are using Inotify, we don't need any call_outs. +  co_id = 1; + #else +  if (backend) co_id = backend->call_out(backend_check, t); +  else co_id = call_out(backend_check, t); + #endif /* HAVE_EVENTSTREAM */   }      //! Set the @[default_max_dir_check_interval].