I see 2 remaining problems:

line 149:

   tw = _eina_thread_win32_find(index);

index is not defined. Do you mean t instead of index ?

Second problem : _current_index. It is initialized to 1, then the only
other use of _current_index is :

        do {
           tw->index = _current_index++;
        } while (tw->index == 0);

so I doubt that one day, tw->index will be 0.

Vincent


On Sun, Oct 28, 2012 at 1:10 PM, Enlightenment SVN
<[email protected]> wrote:
> Log:
> eina: try to fix my own mess.
>
>
> Author:       cedric
> Date:         2012-10-28 05:10:36 -0700 (Sun, 28 Oct 2012)
> New Revision: 78585
> Trac:         http://trac.enlightenment.org/e/changeset/78585
>
> Modified:
>   trunk/efl/src/lib/eina/eina_thread.c
>
> Modified: trunk/efl/src/lib/eina/eina_thread.c
> ===================================================================
> --- trunk/efl/src/lib/eina/eina_thread.c        2012-10-28 10:33:48 UTC (rev 
> 78584)
> +++ trunk/efl/src/lib/eina/eina_thread.c        2012-10-28 12:10:36 UTC (rev 
> 78585)
> @@ -41,7 +41,7 @@
>  struct _Eina_Thread_Win32
>  {
>     HANDLE thread;
> -   Eina_Thread_Cb func;
> +   void *(*func)(void *data);
>     void *data;
>     void *ret;
>
> @@ -94,7 +94,7 @@
>  {
>     Eina_Thread_Win32 *tw = lpParam;
>
> -   tw->ret = tw->func(tw->data, tw->index);
> +   tw->ret = tw->func(tw->data);
>
>     return 0;
>  }
> @@ -102,7 +102,7 @@
>  static Eina_Bool
>  _eina_thread_win32_create(Eina_Thread *t,
>                            int affinity,
> -                          Eina_Thread_Cb func,
> +                          void *(*func)(void *data),
>                            const void *data)
>  {
>     Eina_Thread_Win32 *tw;
> @@ -127,17 +127,14 @@
>     tw->thread = CreateThread(NULL, 0, _eina_thread_win32_cb, tw, 0, NULL);
>     if (!tw->thread) goto on_error;
>
> -   if (!SetThreadAffinityMask(tw->thread, 1 << affinity))
> -     goto close_thread;
> +   /* affinity is an hint, if we fail, we continue without */
> +   SetThreadAffinityMask(tw->thread, 1 << affinity);
>
>     _thread_running = eina_list_append(_thread_running, tw);
>
>     *t = tw->index;
>     return EINA_TRUE;
>
> - close_thread:
> -   CloseHandle(tw->thread);
> -   tw->thread = NULL;
>   on_error:
>     _thread_pool = eina_list_append(_thread_pool, tw);
>     return EINA_FALSE;
>
>
> ------------------------------------------------------------------------------
> WINDOWS 8 is here.
> Millions of people.  Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn

------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to