[ecore] fix compilation when pthread is not available
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 22 Oct 2010 17:39:25 +0000 (17:39 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 22 Oct 2010 17:39:25 +0000 (17:39 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@53777 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_thread.c

index 34b9a60..09af8c8 100644 (file)
@@ -471,9 +471,10 @@ ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
                  Ecore_Cb func_cancel,
                  const void *data)
 {
-#ifdef EFL_HAVE_PTHREAD
    Ecore_Pthread_Worker *work;
+#ifdef EFL_HAVE_PTHREAD
    Ecore_Pthread_Data *pth = NULL;
+#endif
 
    if (!func_blocking) return NULL;
 
@@ -485,9 +486,6 @@ ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
      }
 
    work->u.short_run.func_blocking = func_blocking;
-   work->hash = NULL;
-   pthread_cond_init(&work->cond, NULL);
-   pthread_mutex_init(&work->mutex, NULL);
    work->func_end = func_end;
    work->func_cancel = func_cancel;
    work->cancel = EINA_FALSE;
@@ -495,6 +493,11 @@ ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
    work->kill = EINA_FALSE;
    work->data = data;
 
+#ifdef EFL_HAVE_PTHREAD
+   work->hash = NULL;
+   pthread_cond_init(&work->cond, NULL);
+   pthread_mutex_init(&work->mutex, NULL);
+
    pthread_mutex_lock(&_ecore_pending_job_threads_mutex);
    _ecore_pending_job_threads = eina_list_append(_ecore_pending_job_threads, work);