{
Ecore_Pipe *p;
- if (pthread_join(pth->thread, (void**) &p) != 0)
+ if (pthread_join(pth->thread, (void **) &p) != 0)
return ;
_ecore_thread = eina_list_remove(_ecore_thread, pth);
{
Ecore_Pthread_Worker *work;
- if (nbyte != sizeof (Ecore_Pthread_Worker*)) return ;
+ if (nbyte != sizeof (Ecore_Pthread_Worker *)) return ;
- work = *(Ecore_Pthread_Worker**)buffer;
+ work = *(Ecore_Pthread_Worker **)buffer;
if (work->cancel)
{
if (work->func_cancel)
- work->func_cancel((void*) work->data);
+ work->func_cancel((void *) work->data);
}
else
{
if (work->func_end)
- work->func_end((void*) work->data);
+ work->func_end((void *) work->data);
}
if (work->long_run) ecore_pipe_del(work->u.long_run.notify);
Ecore_Pthread_Worker *work = data;
void *user_data;
- if (nbyte != sizeof (Ecore_Pthread_Worker*)) return ;
+ if (nbyte != sizeof (Ecore_Pthread_Worker *)) return ;
- user_data = *(void**)buffer;
+ user_data = *(void **)buffer;
if (work->u.long_run.func_notify)
- work->u.long_run.func_notify((Ecore_Thread *) work, user_data, (void*) work->data);
+ work->u.long_run.func_notify((Ecore_Thread *) work, user_data, (void *) work->data);
}
static void
pthread_mutex_unlock(&_mutex);
- work->u.short_run.func_blocking((void*) work->data);
+ work->u.short_run.func_blocking((void *) work->data);
- ecore_pipe_write(end_pipe, &work, sizeof (Ecore_Pthread_Worker*));
+ ecore_pipe_write(end_pipe, &work, sizeof (Ecore_Pthread_Worker *));
}
}
pthread_mutex_unlock(&_mutex);
work->u.long_run.self = thread;
- work->u.long_run.func_heavy((Ecore_Thread *) work, (void*) work->data);
+ work->u.long_run.func_heavy((Ecore_Thread *) work, (void *) work->data);
- ecore_pipe_write(end_pipe, &work, sizeof (Ecore_Pthread_Worker*));
+ ecore_pipe_write(end_pipe, &work, sizeof (Ecore_Pthread_Worker *));
}
}
pth->thread = pthread_self();
work->u.long_run.self = pth->thread;
- work->u.long_run.func_heavy((Ecore_Thread *) work, (void*) work->data);
+ work->u.long_run.func_heavy((Ecore_Thread *) work, (void *) work->data);
- ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker*));
+ ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker *));
work = malloc(sizeof (Ecore_Pthread_Worker));
if (!work)
work->data = pth;
work->u.short_run.func_blocking = NULL;
- work->func_end = (void*) _ecore_thread_end;
+ work->func_end = (void *) _ecore_thread_end;
work->func_cancel = NULL;
work->cancel = EINA_FALSE;
work->long_run = EINA_FALSE;
- ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker*));
+ ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker *));
return pth->p;
}
work->data = pth;
work->u.short_run.func_blocking = NULL;
- work->func_end = (void*) _ecore_thread_end;
+ work->func_end = (void *) _ecore_thread_end;
work->func_cancel = NULL;
work->cancel = EINA_FALSE;
work->long_run = EINA_FALSE;
- ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker*));
+ ecore_pipe_write(pth->p, &work, sizeof (Ecore_Pthread_Worker *));
return pth->p;
}
EINA_LIST_FREE(_ecore_thread_data, work)
{
if (work->func_cancel)
- work->func_cancel((void*)work->data);
+ work->func_cancel((void *)work->data);
free(work);
}
work = malloc(sizeof (Ecore_Pthread_Worker));
if (!work)
{
- func_cancel((void*) data);
+ func_cancel((void *) data);
return NULL;
}
if (_ecore_thread_count == _ecore_thread_count_max)
{
pthread_mutex_unlock(&_mutex);
- return (Ecore_Thread*) work;
+ return (Ecore_Thread *) work;
}
pthread_mutex_unlock(&_mutex);
pth->p = ecore_pipe_add(_ecore_thread_handler, NULL);
if (!pth->p) goto on_error;
- if (pthread_create(&pth->thread, NULL, (void*) _ecore_thread_worker, pth) == 0)
- return (Ecore_Thread*) work;
+ if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth) == 0)
+ return (Ecore_Thread *) work;
on_error:
if (pth)
if (_ecore_thread_count == 0)
{
if (work->func_cancel)
- work->func_cancel((void*) work->data);
+ work->func_cancel((void *) work->data);
free(work);
work = NULL;
}
- return (Ecore_Thread*) work;
+ return (Ecore_Thread *) work;
#else
/*
If no thread and as we don't want to break app that rely on this
pthread_mutex_lock(&_mutex);
EINA_LIST_FOREACH(_ecore_thread_data, l, work)
- if ((void*) work == (void*) thread)
+ if ((void *) work == (void *) thread)
{
_ecore_thread_data = eina_list_remove_list(_ecore_thread_data, l);
pthread_mutex_unlock(&_mutex);
if (work->func_cancel)
- work->func_cancel((void*) work->data);
+ work->func_cancel((void *) work->data);
free(work);
return EINA_TRUE;
pthread_mutex_unlock(&_mutex);
/* Delay the destruction */
- ((Ecore_Pthread_Worker*)thread)->cancel = EINA_TRUE;
+ ((Ecore_Pthread_Worker *)thread)->cancel = EINA_TRUE;
return EINA_FALSE;
#else
return EINA_TRUE;
EAPI Eina_Bool
ecore_thread_check(Ecore_Thread *thread)
{
- Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
+ Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *) thread;
if (!worker) return EINA_TRUE;
return worker->cancel;
{
pthread_t t;
- if (pthread_create(&t, NULL, (void*) _ecore_direct_worker, worker) == 0)
- return (Ecore_Thread*) worker;
+ if (pthread_create(&t, NULL, (void *) _ecore_direct_worker, worker) == 0)
+ return (Ecore_Thread *) worker;
}
pthread_mutex_lock(&_mutex);
if (_ecore_thread_count == _ecore_thread_count_max)
{
pthread_mutex_unlock(&_mutex);
- return (Ecore_Thread*) worker;
+ return (Ecore_Thread *) worker;
}
pthread_mutex_unlock(&_mutex);
pth->p = ecore_pipe_add(_ecore_thread_handler, NULL);
if (pth->p) goto on_error;
- if (pthread_create(&pth->thread, NULL, (void*) _ecore_thread_worker, pth) == 0)
- return (Ecore_Thread*) worker;
+ if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth) == 0)
+ return (Ecore_Thread *) worker;
on_error:
if (pth)
if (_ecore_thread_count == 0)
{
- if (func_cancel) func_cancel((void*) data);
+ if (func_cancel) func_cancel((void *) data);
if (worker)
{
}
}
- return (Ecore_Thread*) worker;
+ return (Ecore_Thread *) worker;
#else
Ecore_Pthread_Worker worker;
worker.cancel = EINA_FALSE;
worker.long_run = EINA_TRUE;
- func_heavy((Ecore_Thread*) &worker, data);
+ func_heavy((Ecore_Thread *) &worker, data);
if (worker.cancel) func_cancel(data);
else func_end(data);
EAPI Eina_Bool
ecore_thread_notify(Ecore_Thread *thread, const void *data)
{
- Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
+ Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *) thread;
if (!worker) return EINA_FALSE;
if (!worker->long_run) return EINA_FALSE;
#ifdef EFL_HAVE_PTHREAD
if (worker->u.long_run.self != pthread_self()) return EINA_FALSE;
- ecore_pipe_write(worker->u.long_run.notify, &data, sizeof (void*));
+ ecore_pipe_write(worker->u.long_run.notify, &data, sizeof (void *));
return EINA_TRUE;
#else