static Ecore_Pthread_Worker *
_ecore_thread_worker_new(void)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *result;
-#ifdef EFL_HAVE_THREADS
result = eina_trash_pop(&_ecore_thread_worker_trash);
if (!result) result = malloc(sizeof (Ecore_Pthread_Worker));
((Ecore_Pthread_Worker *)thread)->cancel = EINA_TRUE;
return EINA_FALSE;
#else
+ (void) thread;
return EINA_TRUE;
#endif
}
EAPI int
ecore_thread_pending_get(void)
{
- int ret;
#ifdef EFL_HAVE_THREADS
+ int ret;
+
LKL(_ecore_pending_job_threads_mutex);
ret = eina_list_count(_ecore_pending_job_threads);
LKU(_ecore_pending_job_threads_mutex);
EAPI int
ecore_thread_pending_feedback_get(void)
{
- int ret;
#ifdef EFL_HAVE_THREADS
+ int ret;
+
LKL(_ecore_pending_job_threads_mutex);
ret = eina_list_count(_ecore_pending_job_threads_feedback);
LKU(_ecore_pending_job_threads_mutex);
EAPI int
ecore_thread_pending_total_get(void)
{
- int ret;
#ifdef EFL_HAVE_THREADS
+ int ret;
+
LKL(_ecore_pending_job_threads_mutex);
ret = eina_list_count(_ecore_pending_job_threads) + eina_list_count(_ecore_pending_job_threads_feedback);
LKU(_ecore_pending_job_threads_mutex);
EAPI int
ecore_thread_available_get(void)
{
- int ret;
#ifdef EFL_HAVE_THREADS
+ int ret;
+
LKL(_ecore_pending_job_threads_mutex);
ret = _ecore_thread_count_max - _ecore_thread_count;
LKU(_ecore_pending_job_threads_mutex);
Eina_Free_Cb cb,
Eina_Bool direct)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
Eina_Bool ret;
+#endif
if ((!thread) || (!key) || (!value))
return EINA_FALSE;
CDB(worker->cond);
return ret;
#else
- return EINA_TRUE;
+ (void) cb;
+ (void) direct;
+ return EINA_FALSE;
#endif
}
void *value,
Eina_Free_Cb cb)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d, *r;
void *ret;
+#endif
+
if ((!thread) || (!key) || (!value))
return NULL;
#ifdef EFL_HAVE_THREADS
free(r);
return ret;
#else
+ (void) cb;
return NULL;
#endif
}
ecore_thread_local_data_find(Ecore_Thread *thread,
const char *key)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
+#endif
if ((!thread) || (!key))
return NULL;
ecore_thread_local_data_del(Ecore_Thread *thread,
const char *key)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
+#endif
+
if ((!thread) || (!key))
return EINA_FALSE;
#ifdef EFL_HAVE_THREADS
Eina_Free_Cb cb,
Eina_Bool direct)
{
- Eina_Bool ret;
+#ifdef EFL_HAVE_THREADS
Ecore_Thread_Data *d;
+ Eina_Bool ret;
+#endif
if ((!key) || (!value))
return EINA_FALSE;
CDB(_ecore_thread_global_hash_cond);
return ret;
#else
+ (void) cb;
+ (void) direct;
return EINA_TRUE;
#endif
}
void *value,
Eina_Free_Cb cb)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Thread_Data *d, *r;
void *ret;
+#endif
if ((!key) || (!value))
return NULL;
free(r);
return ret;
#else
+ (void) cb;
return NULL;
#endif
}
EAPI void *
ecore_thread_global_data_find(const char *key)
{
+#ifdef EFL_HAVE_THREADS
Ecore_Thread_Data *ret;
+#endif
+
if (!key)
return NULL;
#ifdef EFL_HAVE_THREADS
EAPI Eina_Bool
ecore_thread_global_data_del(const char *key)
{
+#ifdef EFL_HAVE_THREADS
Eina_Bool ret;
+#endif
if (!key)
return EINA_FALSE;
ecore_thread_global_data_wait(const char *key,
double seconds)
{
+#ifdef EFL_HAVE_THREADS
double tm = 0;
Ecore_Thread_Data *ret = NULL;
+#endif
if (!key)
return NULL;
if (ret) return ret->data;
return NULL;
#else
+ (void) seconds;
return NULL;
#endif
}