ecore_thread: reset waiter and worker when we have failed
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Tue, 27 Dec 2016 21:25:30 +0000 (22:25 +0100)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Wed, 28 Dec 2016 11:19:40 +0000 (12:19 +0100)
otherwise the func_end and func_cancel can get into a endless recursion.

src/lib/ecore/ecore_thread.c

index 8af47af..5abe7a2 100644 (file)
@@ -863,7 +863,15 @@ ecore_thread_wait(Ecore_Thread *thread, double wait)
         if (wait <= 0) break;
      }
 
-   return (waiter.data == NULL) ? EINA_TRUE : EINA_FALSE;
+   if (!waiter.data)
+     {
+        return EINA_TRUE;
+     }
+   else
+     {
+        _ecore_thread_wait_reset(&waiter, worker);
+        return EINA_FALSE;
+     }
 }
 
 EAPI Eina_Bool