2011-04-25 10:04:46 -07:00
|
|
|
/* EIO - EFL data type library
|
|
|
|
* Copyright (C) 2011 Enlightenment Developers:
|
|
|
|
* Cedric Bail <cedric.bail@free.fr>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "eio_private.h"
|
|
|
|
#include "Eio.h"
|
|
|
|
|
2012-03-31 00:01:24 -07:00
|
|
|
/*============================================================================*
|
|
|
|
* Local *
|
|
|
|
*============================================================================*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @cond LOCAL
|
|
|
|
*/
|
|
|
|
|
2012-02-27 12:58:26 -08:00
|
|
|
typedef struct _Eio_Monitor_Stat Eio_Monitor_Stat;
|
2012-03-31 00:01:24 -07:00
|
|
|
|
2012-02-27 12:58:26 -08:00
|
|
|
struct _Eio_Monitor_Stat
|
|
|
|
{
|
|
|
|
Eina_Stat buffer;
|
|
|
|
int version;
|
|
|
|
};
|
|
|
|
|
2011-04-25 10:04:46 -07:00
|
|
|
struct _Eio_Monitor_Backend
|
|
|
|
{
|
2012-02-27 05:20:05 -08:00
|
|
|
Eio_Monitor *parent;
|
|
|
|
|
2012-02-27 12:58:26 -08:00
|
|
|
Eina_Stat self;
|
|
|
|
Eina_Hash *children;
|
|
|
|
|
2012-02-27 05:20:05 -08:00
|
|
|
Ecore_Timer *timer;
|
|
|
|
Ecore_Thread *work;
|
|
|
|
|
2012-02-27 12:58:26 -08:00
|
|
|
int version;
|
|
|
|
|
2012-02-27 05:20:05 -08:00
|
|
|
Eina_Bool delete_me : 1;
|
2012-02-27 12:58:26 -08:00
|
|
|
Eina_Bool initialised : 1;
|
|
|
|
Eina_Bool destroyed : 1;
|
2011-04-25 10:04:46 -07:00
|
|
|
};
|
|
|
|
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
static double fallback_interval = 60.0;
|
|
|
|
static Eina_Hash *timer_hash;
|
|
|
|
|
2012-02-27 05:20:05 -08:00
|
|
|
static Eina_Bool _eio_monitor_fallback_timer_cb(void *data);
|
|
|
|
|
|
|
|
static void
|
|
|
|
_eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
|
|
|
|
{
|
2012-02-27 12:58:26 -08:00
|
|
|
Eio_Monitor_Backend *backend = data;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
Eina_Stat *est;
|
|
|
|
Eina_File_Direct_Info *info;
|
2012-03-30 23:30:08 -07:00
|
|
|
_eio_stat_t st;
|
2018-06-27 05:48:59 -07:00
|
|
|
Eina_Bool deleted = EINA_FALSE;
|
2012-02-27 12:58:26 -08:00
|
|
|
/* FIXME : copy ecore_file_monitor_poll here */
|
|
|
|
|
|
|
|
if (!backend->initialised)
|
|
|
|
est = &backend->self;
|
|
|
|
else
|
|
|
|
est = alloca(sizeof (Eina_Stat));
|
|
|
|
|
|
|
|
if (!backend->parent)
|
2013-06-20 04:28:18 -07:00
|
|
|
return;
|
2012-02-27 12:58:26 -08:00
|
|
|
|
2012-03-30 23:30:08 -07:00
|
|
|
if (_eio_stat(backend->parent->path, &st))
|
2012-02-27 12:58:26 -08:00
|
|
|
{
|
|
|
|
if (backend->initialised && !backend->destroyed)
|
|
|
|
{
|
|
|
|
ecore_thread_main_loop_begin();
|
2018-06-27 05:48:59 -07:00
|
|
|
deleted = backend->delete_me;
|
|
|
|
if (!deleted)
|
|
|
|
_eio_monitor_send(backend->parent, backend->parent->path, EIO_MONITOR_SELF_DELETED);
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_end();
|
|
|
|
backend->destroyed = EINA_TRUE;
|
|
|
|
}
|
2013-06-20 04:28:18 -07:00
|
|
|
return;
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
backend->destroyed = EINA_FALSE;
|
|
|
|
|
|
|
|
est->dev = st.st_dev;
|
|
|
|
est->ino = st.st_ino;
|
|
|
|
est->mode = st.st_mode;
|
|
|
|
est->nlink = st.st_nlink;
|
|
|
|
est->uid = st.st_uid;
|
|
|
|
est->gid = st.st_gid;
|
|
|
|
est->rdev = st.st_rdev;
|
|
|
|
est->size = st.st_size;
|
2012-03-30 23:30:08 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
est->blksize = 0;
|
|
|
|
est->blocks = 0;
|
|
|
|
#else
|
2012-02-27 12:58:26 -08:00
|
|
|
est->blksize = st.st_blksize;
|
|
|
|
est->blocks = st.st_blocks;
|
2012-03-30 23:30:08 -07:00
|
|
|
#endif
|
2012-02-27 12:58:26 -08:00
|
|
|
est->atime = st.st_atime;
|
|
|
|
est->mtime = st.st_mtime;
|
|
|
|
est->ctime = st.st_ctime;
|
|
|
|
#ifdef _STAT_VER_LINUX
|
|
|
|
# if (defined __USE_MISC && defined st_mtime)
|
|
|
|
est->atimensec = st.st_atim.tv_nsec;
|
|
|
|
est->mtimensec = st.st_mtim.tv_nsec;
|
|
|
|
est->ctimensec = st.st_ctim.tv_nsec;
|
|
|
|
# else
|
|
|
|
est->atimensec = st.st_atimensec;
|
|
|
|
est->mtimensec = st.st_mtimensec;
|
|
|
|
est->ctimensec = st.st_ctimensec;
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
est->atimensec = 0;
|
|
|
|
est->mtimensec = 0;
|
|
|
|
est->ctimensec = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (memcmp(est, &backend->self, sizeof (Eina_Stat)) != 0)
|
|
|
|
{
|
2018-06-26 14:49:56 -07:00
|
|
|
int event = EIO_MONITOR_DIRECTORY_MODIFIED;
|
|
|
|
|
|
|
|
if (!S_ISDIR(est->mode))
|
|
|
|
/* regular file: eina_file_direct_ls will return NULL */
|
|
|
|
event = EIO_MONITOR_FILE_MODIFIED;
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_begin();
|
2018-06-27 05:48:59 -07:00
|
|
|
deleted = backend->delete_me;
|
|
|
|
if (!deleted)
|
|
|
|
_eio_monitor_send(backend->parent, backend->parent->path, event);
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_end();
|
2018-06-27 05:48:59 -07:00
|
|
|
if (deleted) return;
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
it = eina_file_direct_ls(backend->parent->path);
|
|
|
|
EINA_ITERATOR_FOREACH(it, info)
|
|
|
|
{
|
|
|
|
Eio_Monitor_Stat *cmp;
|
|
|
|
Eio_Monitor_Stat buffer;
|
|
|
|
|
|
|
|
if (!backend->initialised)
|
|
|
|
cmp = calloc(1, sizeof (Eio_Monitor_Stat));
|
|
|
|
else
|
|
|
|
cmp = &buffer;
|
|
|
|
|
|
|
|
if (eina_file_statat(eina_iterator_container_get(it), info, &cmp->buffer))
|
|
|
|
{
|
|
|
|
if (!backend->initialised) free(cmp);
|
|
|
|
continue ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!backend->initialised)
|
|
|
|
{
|
2015-10-04 01:43:54 -07:00
|
|
|
eina_hash_add(backend->children, info->path, cmp);
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-10-04 01:43:54 -07:00
|
|
|
cmp = eina_hash_find(backend->children, info->path);
|
2012-02-27 12:58:26 -08:00
|
|
|
if (!cmp)
|
|
|
|
{
|
|
|
|
/* New file or new directory added */
|
|
|
|
ecore_thread_main_loop_begin();
|
2018-06-27 05:48:59 -07:00
|
|
|
deleted = backend->delete_me;
|
|
|
|
if (!deleted)
|
|
|
|
_eio_monitor_send(backend->parent, info->path,
|
|
|
|
info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_CREATED : EIO_MONITOR_DIRECTORY_CREATED);
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_end();
|
2018-06-27 05:48:59 -07:00
|
|
|
if (deleted) break;
|
2012-02-27 12:58:26 -08:00
|
|
|
cmp = malloc(sizeof (Eio_Monitor_Stat));
|
|
|
|
memcpy(cmp, &buffer, sizeof (Eina_Stat));
|
|
|
|
|
2015-10-04 01:43:54 -07:00
|
|
|
eina_hash_add(backend->children, info->path, cmp);
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
|
|
|
else if (memcmp(cmp, &buffer, sizeof (Eina_Stat)) != 0)
|
|
|
|
{
|
|
|
|
/* file has been modified */
|
|
|
|
ecore_thread_main_loop_begin();
|
2018-06-27 05:48:59 -07:00
|
|
|
deleted = backend->delete_me;
|
|
|
|
if (!deleted)
|
|
|
|
_eio_monitor_send(backend->parent, info->path,
|
|
|
|
info->type != EINA_FILE_DIR ? EIO_MONITOR_FILE_MODIFIED : EIO_MONITOR_DIRECTORY_MODIFIED);
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_end();
|
2018-06-27 05:48:59 -07:00
|
|
|
if (deleted) break;
|
2012-02-27 12:58:26 -08:00
|
|
|
memcpy(cmp, &buffer, sizeof (Eina_Stat));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cmp->version = backend->version;
|
2018-06-27 05:48:59 -07:00
|
|
|
if (ecore_thread_check(thread)) break;
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
2018-06-27 05:48:59 -07:00
|
|
|
|
2012-07-03 04:32:35 -07:00
|
|
|
if (it) eina_iterator_free(it);
|
2012-02-27 12:58:26 -08:00
|
|
|
|
|
|
|
if (backend->initialised && !ecore_thread_check(thread))
|
|
|
|
{
|
|
|
|
Eina_Hash_Tuple *tuple;
|
2018-06-26 15:15:10 -07:00
|
|
|
Eina_Array *arr;
|
2012-02-27 12:58:26 -08:00
|
|
|
|
|
|
|
it = eina_hash_iterator_tuple_new(backend->children);
|
2018-06-26 15:15:10 -07:00
|
|
|
arr = eina_array_new(1);
|
2012-02-27 12:58:26 -08:00
|
|
|
ecore_thread_main_loop_begin();
|
|
|
|
|
|
|
|
EINA_ITERATOR_FOREACH(it, tuple)
|
|
|
|
{
|
|
|
|
Eio_Monitor_Stat *cmp = tuple->data;
|
|
|
|
|
|
|
|
if (cmp->version != backend->version)
|
|
|
|
{
|
2018-06-27 05:48:59 -07:00
|
|
|
deleted = backend->delete_me;
|
|
|
|
if (deleted) break;
|
2012-02-27 12:58:26 -08:00
|
|
|
_eio_monitor_send(backend->parent, tuple->key,
|
|
|
|
eio_file_is_dir(&cmp->buffer) ? EIO_MONITOR_DIRECTORY_DELETED : EIO_MONITOR_FILE_DELETED);
|
2018-06-26 15:15:10 -07:00
|
|
|
eina_array_push(arr, tuple->key);
|
2012-02-27 12:58:26 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ecore_thread_main_loop_end();
|
2018-06-26 15:15:10 -07:00
|
|
|
while (eina_array_count(arr))
|
2018-08-12 01:21:19 -07:00
|
|
|
eina_hash_del_by_key(backend->children, eina_array_pop(arr));
|
2018-06-26 15:15:10 -07:00
|
|
|
eina_array_free(arr);
|
2012-02-27 12:58:26 -08:00
|
|
|
eina_iterator_free(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
backend->version++;
|
|
|
|
backend->initialised = EINA_TRUE;
|
2012-02-27 05:20:05 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-04 09:40:58 -08:00
|
|
|
_eio_monitor_fallback_end_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
|
2012-02-27 05:20:05 -08:00
|
|
|
{
|
|
|
|
Eio_Monitor_Backend *backend = data;
|
|
|
|
|
|
|
|
backend->work = NULL;
|
2018-06-26 13:39:53 -07:00
|
|
|
if (backend->delete_me)
|
|
|
|
{
|
|
|
|
eina_hash_free(backend->children);
|
|
|
|
free(backend);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
/* indicates eio shutdown is in progress */
|
|
|
|
if (!timer_hash) return;
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
backend->timer = ecore_timer_add(fallback_interval, _eio_monitor_fallback_timer_cb, backend);
|
|
|
|
eina_hash_set(timer_hash, &backend, backend->timer);
|
2012-02-27 05:20:05 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-04 09:40:58 -08:00
|
|
|
_eio_monitor_fallback_cancel_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
|
2012-02-27 05:20:05 -08:00
|
|
|
{
|
|
|
|
Eio_Monitor_Backend *backend = data;
|
|
|
|
|
|
|
|
backend->work = NULL;
|
|
|
|
if (backend->delete_me)
|
|
|
|
{
|
2018-06-26 13:39:53 -07:00
|
|
|
eina_hash_free(backend->children);
|
2012-02-27 05:20:05 -08:00
|
|
|
free(backend);
|
2013-06-20 04:28:18 -07:00
|
|
|
return;
|
2012-02-27 05:20:05 -08:00
|
|
|
}
|
2018-06-26 13:39:53 -07:00
|
|
|
/* indicates eio shutdown is in progress */
|
|
|
|
if (!timer_hash) return;
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
backend->timer = ecore_timer_add(fallback_interval, _eio_monitor_fallback_timer_cb, backend);
|
|
|
|
eina_hash_set(timer_hash, &backend, backend->timer);
|
2012-02-27 05:20:05 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2018-06-26 13:42:04 -07:00
|
|
|
_eio_monitor_fallback_timer_cb(void *data)
|
2012-02-27 05:20:05 -08:00
|
|
|
{
|
|
|
|
Eio_Monitor_Backend *backend = data;
|
|
|
|
|
2018-06-26 13:42:04 -07:00
|
|
|
backend->timer = NULL;
|
|
|
|
eina_hash_set(timer_hash, &backend, NULL);
|
2012-02-27 05:20:05 -08:00
|
|
|
backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb,
|
|
|
|
_eio_monitor_fallback_end_cb,
|
|
|
|
_eio_monitor_fallback_cancel_cb,
|
|
|
|
backend);
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-03-31 00:01:24 -07:00
|
|
|
/**
|
|
|
|
* @endcond
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*============================================================================*
|
|
|
|
* Global *
|
|
|
|
*============================================================================*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @cond LOCAL
|
|
|
|
*/
|
|
|
|
|
2015-09-21 15:13:34 -07:00
|
|
|
#if !defined HAVE_SYS_INOTIFY_H && !defined HAVE_NOTIFY_WIN32 && !defined HAVE_NOTIFY_COCOA \
|
|
|
|
&& !defined HAVE_NOTIFY_KEVENT
|
2012-03-31 00:01:24 -07:00
|
|
|
void eio_monitor_backend_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void eio_monitor_backend_shutdown(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void eio_monitor_backend_add(Eio_Monitor *monitor)
|
|
|
|
{
|
|
|
|
eio_monitor_fallback_add(monitor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void eio_monitor_backend_del(Eio_Monitor *monitor)
|
|
|
|
{
|
|
|
|
eio_monitor_fallback_del(monitor);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-04-25 10:04:46 -07:00
|
|
|
void
|
|
|
|
eio_monitor_fallback_init(void)
|
|
|
|
{
|
2018-06-26 13:38:20 -07:00
|
|
|
timer_hash = eina_hash_pointer_new(NULL);
|
2011-04-25 10:04:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
eio_monitor_fallback_shutdown(void)
|
|
|
|
{
|
2018-06-26 13:38:20 -07:00
|
|
|
eina_hash_free(timer_hash);
|
|
|
|
timer_hash = NULL;
|
2011-04-25 10:04:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-02-27 05:20:05 -08:00
|
|
|
eio_monitor_fallback_add(Eio_Monitor *monitor)
|
2011-04-25 10:04:46 -07:00
|
|
|
{
|
2012-02-27 05:20:05 -08:00
|
|
|
Eio_Monitor_Backend *backend;
|
|
|
|
|
|
|
|
monitor->backend = NULL;
|
|
|
|
|
|
|
|
backend = calloc(1, sizeof (Eio_Monitor_Backend));
|
2013-06-20 04:28:18 -07:00
|
|
|
if (!backend) return;
|
2012-02-27 05:20:05 -08:00
|
|
|
|
2012-02-27 12:58:26 -08:00
|
|
|
backend->children = eina_hash_string_superfast_new(free);
|
2012-02-27 05:20:05 -08:00
|
|
|
backend->parent = monitor;
|
|
|
|
monitor->backend = backend;
|
2018-06-26 15:10:19 -07:00
|
|
|
monitor->fallback = EINA_TRUE;
|
2012-02-27 12:58:26 -08:00
|
|
|
backend->work = ecore_thread_run(_eio_monitor_fallback_heavy_cb,
|
|
|
|
_eio_monitor_fallback_end_cb,
|
|
|
|
_eio_monitor_fallback_cancel_cb,
|
|
|
|
backend);
|
2011-04-25 10:04:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-02-27 05:20:05 -08:00
|
|
|
eio_monitor_fallback_del(Eio_Monitor *monitor)
|
2011-04-25 10:04:46 -07:00
|
|
|
{
|
2012-02-27 05:20:05 -08:00
|
|
|
Eio_Monitor_Backend *backend;
|
|
|
|
|
|
|
|
backend = monitor->backend;
|
|
|
|
monitor->backend = NULL;
|
|
|
|
|
2013-06-20 04:28:18 -07:00
|
|
|
if (!backend) return;
|
2018-06-26 13:39:53 -07:00
|
|
|
backend->delete_me = EINA_TRUE;
|
2012-02-27 05:20:05 -08:00
|
|
|
|
2015-08-19 11:21:02 -07:00
|
|
|
|
2012-02-27 05:20:05 -08:00
|
|
|
if (backend->timer) ecore_timer_del(backend->timer);
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
eina_hash_set(timer_hash, &backend, NULL);
|
2012-02-27 05:20:05 -08:00
|
|
|
backend->timer = NULL;
|
2015-08-19 11:21:02 -07:00
|
|
|
|
2018-06-26 13:39:53 -07:00
|
|
|
if (backend->work)
|
2012-02-27 05:20:05 -08:00
|
|
|
{
|
2018-06-26 13:39:53 -07:00
|
|
|
ecore_thread_cancel(backend->work);
|
2013-06-20 04:28:18 -07:00
|
|
|
return;
|
2012-02-27 05:20:05 -08:00
|
|
|
}
|
2015-08-19 11:21:02 -07:00
|
|
|
|
|
|
|
backend->parent = NULL;
|
2012-08-02 01:10:18 -07:00
|
|
|
eina_hash_free(backend->children);
|
2012-02-27 05:20:05 -08:00
|
|
|
free(backend);
|
2011-04-25 10:04:46 -07:00
|
|
|
}
|
2012-03-31 00:01:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @endcond
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*============================================================================*
|
|
|
|
* API *
|
|
|
|
*============================================================================*/
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
eio_monitoring_interval_set(double interval)
|
|
|
|
{
|
|
|
|
Eina_Iterator *it;
|
|
|
|
Ecore_Timer *timer;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(interval < 0.0);
|
|
|
|
fallback_interval = interval;
|
|
|
|
if (!timer_hash) return;
|
|
|
|
it = eina_hash_iterator_data_new(timer_hash);
|
|
|
|
EINA_ITERATOR_FOREACH(it, timer)
|
|
|
|
ecore_timer_interval_set(timer, fallback_interval);
|
|
|
|
eina_iterator_free(it);
|
|
|
|
}
|
2018-06-26 15:20:37 -07:00
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
eio_monitor_fallback_check(const Eio_Monitor *monitor)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(monitor, EINA_FALSE);
|
|
|
|
return monitor->fallback;
|
|
|
|
}
|