Don't try to sync with 00 sec if the period is < 1
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 20 Dec 2012 14:40:02 +0000 (23:40 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 20 Dec 2012 14:42:59 +0000 (23:42 +0900)
Change-Id: Ib6868a03b774484da27246a13ae9b32afe8dffdd

packaging/com.samsung.data-provider-slave.spec
src/lb.c
src/util.c

index 9384f3f..93a89fd 100644 (file)
@@ -1,6 +1,6 @@
 Name: com.samsung.data-provider-slave
 Summary: Slave data provider
-Version: 0.8.13
+Version: 0.8.14
 Release: 1
 Group: main/app
 License: Flora License
index 56bc478..64434b1 100644 (file)
--- a/src/lb.c
+++ b/src/lb.c
@@ -346,6 +346,9 @@ static inline void timer_freeze(struct item *item)
        struct timeval tv;
        ecore_timer_freeze(item->timer);
 
+       if (ecore_timer_interval_get(item->timer) <= 1.0f)
+               return;
+
        gettimeofday(&tv, NULL);
        item->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
 }
index c0ea002..415f980 100644 (file)
@@ -138,6 +138,11 @@ static inline void compensate_timer(Ecore_Timer *timer)
        double delay;
        double pending;
 
+       if (ecore_timer_interval_get(timer) <= 1.0f) {
+               DbgPrint("Doesn't need to sync the timer to start from ZERO sec\n");
+               return;
+       }
+
        if (gettimeofday(&tv, NULL) < 0) {
                ErrPrint("Error: %s\n", strerror(errno));
                return;