static struct info {
Eina_List *item_list;
- struct item *update;
+ Eina_List *update_list;
Eina_List *pending_list;
Ecore_Timer *pending_timer;
Eina_List *pd_open_pending_list;
int pending_timer_freezed;
} s_info = {
.item_list = NULL,
- .update = NULL,
+ .update_list = NULL,
.pending_list = NULL,
.pending_timer = NULL,
.pd_open_pending_list = NULL,
goto cleanout;
}
- if (s_info.update) {
+ if (eina_list_data_find(s_info.update_list, item)) {
return ECORE_CALLBACK_RENEW;
}
goto cleanout;
}
- if (s_info.update || pd_is_opened(item->inst->item->pkgname) < 0) {
+ if (eina_list_data_find(s_info.update_list, item) || pd_is_opened(item->inst->item->pkgname) < 0) {
return ECORE_CALLBACK_RENEW;
}
static void timer_freeze(struct item *item)
{
- struct timeval tv;
-
if (!item->timer) {
return;
}
return;
}
+#if defined(_USE_ECORE_TIME_GET)
+ item->sleep_at = ecore_time_get();
+#else
+ struct timeval tv;
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
tv.tv_sec = 0;
}
item->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
+#endif
}
static inline void update_monitor_cnt(struct item *item)
* file update callback.
*/
if (interval >= MINIMUM_UPDATE_INTERVAL) {
- if (s_info.update == item) {
+ if (eina_list_data_find(s_info.update_list, item)) {
/*!
* \note
* If already in updating mode,
item->monitor = NULL;
}
- if (s_info.update == item) {
- s_info.update = NULL;
- }
+ s_info.update_list = eina_list_remove(s_info.update_list, item);
if (item->deleteme) {
provider_send_deleted(item->inst->item->pkgname, item->inst->id);
ErrPrint("UPDATE TIMEOUT ========> %s - %s\n", item->inst->item->pkgname, item->inst->id);
- if (s_info.update != item) {
+ if (!eina_list_data_find(s_info.update_list, item)) {
ErrPrint("Updating item is not matched\n");
}
fault_unmark_call(item->inst->item->pkgname, item->inst->id, "update,crashed", NO_ALARM);
fault_mark_call(item->inst->item->pkgname, item->inst->id, "update,timeout", NO_ALARM, DEFAULT_LIFE_TIMER);
- s_info.update = NULL;
+ s_info.update_list = eina_list_remove(s_info.update_list, item);
exit(ETIME);
return ECORE_CALLBACK_CANCEL;
return ECORE_CALLBACK_RENEW;
}
- if (s_info.update || pd_is_opened(item->inst->item->pkgname) < 0) {
- DbgPrint("%s is busy\n", s_info.update ? s_info.update->inst->id : item->inst->id);
+ /*!
+ * \note
+ * Check the update_list, if you want make serialized update
+ */
+ if (/*s_info.update_list || */pd_is_opened(item->inst->item->pkgname) < 0) {
+ DbgPrint("%s is busy\n", item->inst->id);
(void)append_pending_list(item);
return ECORE_CALLBACK_RENEW;
}
* This should be updated after "update_monitor_cnt" function call,
* because the update_monitor_cnt function will see the s_info.update variable,
*/
- s_info.update = item;
+ s_info.update_list = eina_list_append(s_info.update_list, item);
return ECORE_CALLBACK_RENEW;
}
item = eina_list_data_get(l);
s_info.item_list = eina_list_remove_list(s_info.item_list, l);
- if (s_info.update == item) {
- s_info.update = NULL;
- }
+ s_info.update_list = eina_list_remove(s_info.update_list, item);
if (item->timer) {
clear_from_pd_open_pending_list(item);