Hi

On Fri, Oct 24, 2014 at 9:10 AM, Viacheslav Reutskiy <[email protected]>
wrote:

> Hi everyone.
>
> I have one little question about Ecore Thread.
> I need to stop the running thread and get
> notified, I mean call callback, about it event.
>
> Ecore Thread has the function ecore_thread_close(),
> but if this func not stopped the thread, Ecore
> Thread waits until thread is finished, and then call
> the cancel callback.
>
> How I can stop or kill the thread? And if this
> functionality is not available, any plans to add
> it?
>
>
The thread will have to stop itself.
So you need to send an event to request the thread stop.

You can't just kill a thread like that. There are some mechanims like
pthread_cancel but they need to take some extreme precautions (properly
free all resources, etc...). So I wouldn't add this to EFL.

With ecore, you might want to use ecore_thread_cancel and then in the
thread's loop, check for cancellation with ecore_thread_check. This is not
the same as pthread_cancel. It's much easier to use.

I don't know of any way to safely kill a thread that would be stuck in an
infinite loop. (maybe someone else knows?)

Best regards,


-- 
Jean-Philippe André
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to