On Thu, 15 Sep 2016 08:00:46 -0300 Gustavo Sverzut Barbieri
<barbi...@gmail.com> said:

> isn't it better to check in ecore_thread_cancel() if the thread was
> already created?

that'd require keeping track of every thread we create, looking up in that
list/table ever time etc. ... like eoid does. eina_thread stuff is are ally a
tiny tiny tiny thin wrapper over posix (or windows or osx) threading - same
with locks/semaphores etc. at this level such a complex check isn't really worth
it.

> On Wed, Sep 14, 2016 at 8:52 PM, Cedric BAIL <cedric.b...@free.fr> wrote:
> > cedric pushed a commit to branch master.
> >
> > http://git.enlightenment.org/core/efl.git/commit/?id=4d69f472fe31a9006436a05282a8376c7a712d41
> >
> > commit 4d69f472fe31a9006436a05282a8376c7a712d41
> > Author: Cedric Bail <ced...@osg.samsung.com>
> > Date:   Wed Sep 14 16:50:05 2016 -0700
> >
> >     eina: allow graceful failure when calling eina_thread_cancel with NULL.
> > ---
> >  src/lib/eina/eina_thread.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
> > index d40073a..5002a42 100644
> > --- a/src/lib/eina/eina_thread.c
> > +++ b/src/lib/eina/eina_thread.c
> > @@ -230,6 +230,7 @@ eina_thread_name_set(Eina_Thread t, const char *name)
> >  EAPI Eina_Bool
> >  eina_thread_cancel(Eina_Thread t)
> >  {
> > +   if (!t) return EINA_FALSE;
> >     return pthread_cancel((pthread_t)t) == 0;
> >  }
> >
> >
> > --
> >
> >
> 
> 
> 
> -- 
> Gustavo Sverzut Barbieri
> --------------------------------------
> Mobile: +55 (16) 99354-9890
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to