Yo,

(precondition)
CFLAGS=-O0 -march=native -ffast-math -g -ggdb3 -W -Wall -Wextra -mno-sse4
-fvisibility=hidden

(command)
valgrind --leak-check=full elementary_test

(valgrind report)
==13999== Thread 3:
==13999== Jump to the invalid address stated on the next line
==13999==    at 0xD126005: ???
==13999==    by 0x5041D4B: start_thread (pthread_create.c:308)
==13999==    by 0x5145DDD: clone (clone.S:130)
==13999==  Address 0xd126005 is not stack'd, malloc'd or (recently) free'd
==13999==
==13999==
==13999== Process terminating with default action of signal 11 (SIGSEGV)
==13999==  Access not within mapped region at address 0xD126005
==13999==    at 0xD126005: ???
==13999==    by 0x5041D4B: start_thread (pthread_create.c:308)
==13999==    by 0x5145DDD: clone (clone.S:130)
==13999==  If you believe this happened as a result of a stack
==13999==  overflow in your program's main thread (unlikely but
==13999==  possible), you can try to increase the size of the
==13999==  main thread stack using the --main-stacksize= flag.
==13999==  The main thread stack size used in this run was 8388608.
==13999==
==13999== HEAP SUMMARY:
==13999==     in use at exit: 851,355 bytes in 7,594 blocks
==13999==   total heap usage: 325,254 allocs, 250,558 frees, 49,087,652
bytes allocated
==13999==
==13999== Thread 1:
==13999== 23 (16 direct, 7 indirect) bytes in 1 blocks are definitely lost
in loss record 437 of 1,789
==13999==    at 0x482BE68: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13999==    by 0x4BD99B7: eina_str_split_full_helper (eina_str.c:150)
==13999==    by 0x4BDA3DA: eina_str_split (eina_str.c:416)
==13999==    by 0x4844162: _daemon_version_from_variant
(ecore_system_upower.c:236)
==13999==    by 0x48442C4: _daemon_version_get_cb
(ecore_system_upower.c:278)
==13999==    by 0x530D5EE: _on_proxy_message_cb (eldbus_proxy.c:538)
==13999==    by 0x531C7E2: eldbus_pending_dispatch (eldbus_pending.c:234)
==13999==    by 0x531BD0E: cb_pending (eldbus_pending.c:74)
==13999==    by 0x5A8BA60: ??? (in /lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==13999==    by 0x5A76956: ??? (in /lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==13999==    by 0x5A7A236: dbus_connection_dispatch (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==13999==    by 0x53115B1: eldbus_idler (eldbus_core.c:774)
==13999==
==13999== 160 bytes in 1 blocks are possibly lost in loss record 1,375 of
1,789
==13999==    at 0x482A5E6: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13999==    by 0x4011304: allocate_dtv (dl-tls.c:297)
==13999==    by 0x4011AAB: _dl_allocate_tls (dl-tls.c:461)
==13999==    by 0x5042470: pthread_create@@GLIBC_2.1 (allocatestack.c:571)
==13999==    by 0x4BE1032: _eina_thread_create (eina_thread.c:67)
==13999==    by 0x4BE124C: eina_thread_create (eina_thread.c:148)
==13999==    by 0x4D5816E: evas_thread_init (evas_thread_render.c:133)
==13999==    by 0x4C4BFB9: evas_init (evas_main.c:66)
==13999==    by 0x49F49F1: elm_quicklaunch_sub_init (elm_main.c:689)
==13999==    by 0x49F3EA0: elm_init (elm_main.c:310)
==13999==    by 0x11FE5E: main (test.c:965)
==13999==
==13999== 160 bytes in 1 blocks are possibly lost in loss record 1,376 of
1,789
==13999==    at 0x482A5E6: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==13999==    by 0x4011304: allocate_dtv (dl-tls.c:297)
==13999==    by 0x4011AAB: _dl_allocate_tls (dl-tls.c:461)
==13999==    by 0x5042470: pthread_create@@GLIBC_2.1 (allocatestack.c:571)
==13999==    by 0x4BE1032: _eina_thread_create (eina_thread.c:67)
==13999==    by 0x4BE124C: eina_thread_create (eina_thread.c:148)
==13999==    by 0x4D4C18F: evas_common_scale_sample_init
(evas_scale_sample.c:845)
==13999==    by 0x4D333E3: evas_common_init (evas_draw_main.c:48)
==13999==    by 0x7056514: eng_setup (evas_engine.c:438)
==13999==    by 0x4C4CD21: _evas_canvas_engine_info_set (evas_main.c:368)
==13999==    by 0x4C4EA44: evas_canvas_engine_info_set (in
/usr/local/lib/libevas.so.1.13.99)
==13999==    by 0x4C54F0C: evas_engine_info_set (evas_canvas.eo.c:672)
==13999==
==13999== LEAK SUMMARY:
==13999==    definitely lost: 16 bytes in 1 blocks
==13999==    indirectly lost: 7 bytes in 1 blocks
==13999==      possibly lost: 320 bytes in 2 blocks
==13999==    still reachable: 775,564 bytes in 11,240 blocks
==13999==         suppressed: 0 bytes in 0 blocks
==13999== Reachable blocks (those to which a pointer was found) are not
shown.
==13999== To see them, rerun with: --leak-check=full --show-reachable=yes
==13999==
==13999== For counts of detected and suppressed errors, rerun with: -v
==13999== Use --track-origins=yes to see where uninitialised values come
from
==13999== ERROR SUMMARY: 29 errors from 11 contexts (suppressed: 0 from 0)
Killed



On Mon, Feb 23, 2015 at 6:56 PM, Cedric BAIL <cedric.b...@free.fr> wrote:

> Hum,I can't reproduce your issue, but I may have an idea, could you
> recompile your efl with -g -ggdb3 and tell me what valgrind says?
>
> Le 23 févr. 2015 02:26, "Daniel Juyung Seo" <seojuyu...@gmail.com> a
> écrit :
> >
> > Yo,
> > This broke all elm apps.
> > When I close apps, they just crash with this callstack.
> >
> > (gdb) bt
> > #0  0x5c5260b7 in ?? ()
> > #1  0xb7ba2113 in _eina_internal_call () at lib/eina/eina_thread.c:111
> > #2  0xb7b53d4c in start_thread (arg=0xb5b94b40) at pthread_create.c:308
> > #3  0xb7639dde in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
> >
> > Just run terminology and close it.
> > Please check it ASAP.
> > I would not revert it as we're in a development mode.
> >
> > Thanks.
> >
> > Daniel Juyung Seo (SeoZ)
> >
> >
> >
> >
> > On Sat, Feb 21, 2015 at 1:42 AM, Cedric BAIL <cedric.b...@free.fr>
> wrote:
> >
> > > cedric pushed a commit to branch master.
> > >
> > >
> > >
>
> http://git.enlightenment.org/core/efl.git/commit/?id=6bb4ecd65db4cb674ca3dc6ef30ceb1a22445a90
> > >
> > > commit 6bb4ecd65db4cb674ca3dc6ef30ceb1a22445a90
> > > Author: Cedric BAIL <ced...@osg.samsung.com>
> > > Date:   Fri Feb 20 17:11:44 2015 +0100
> > >
> > >     evas: use two thread when scaling image.
> > >
> > >     This is for now just a small experiment. It was based on the
> > > experiment made
> > >     with OpenMP. I prefered to only use Eina here as we have already
> all
> > > the infrastructure
> > >     to do this nicely and simply. As a result I get a 65% speed
> improved
> > > on average for
> > >     the involved scaling operation. The secondary CPU is on my laptop
> > > running with a load of
> > >     75% percent. I don't have right now the time to do power
> consumption
> > > analysis, but I
> > >     think it shouldn't be to bad. I am also not throwing more core at
> this
> > > as we are not able
> > >     to use the second core at its max already, so additional core may
> > > result in a bigger
> > >     energy loss without enough gain.
> > > ---
> > >  src/bin/evas/evas_cserve2_scale.c       |   1 +
> > >  src/lib/evas/common/evas_draw_main.c    |   2 +
> > >  src/lib/evas/common/evas_scale_main.h   |   2 +
> > >  src/lib/evas/common/evas_scale_sample.c | 300
> > > ++++++++++++++++++++++++++++----
> > >  4 files changed, 272 insertions(+), 33 deletions(-)
> > >
> > > diff --git a/src/bin/evas/evas_cserve2_scale.c
> > > b/src/bin/evas/evas_cserve2_scale.c
> > > index dd909db..bf6e940 100644
> > > --- a/src/bin/evas/evas_cserve2_scale.c
> > > +++ b/src/bin/evas/evas_cserve2_scale.c
> > > @@ -9,6 +9,7 @@ cserve2_scale_init(void)
> > >     evas_common_image_init();
> > >     evas_common_convert_init();
> > >     evas_common_scale_init();
> > > +   evas_common_scale_sample_init();
> > >  }
> > >
> > >  void
> > > diff --git a/src/lib/evas/common/evas_draw_main.c
> > > b/src/lib/evas/common/evas_draw_main.c
> > > index 5d1e415..ed1f951 100644
> > > --- a/src/lib/evas/common/evas_draw_main.c
> > > +++ b/src/lib/evas/common/evas_draw_main.c
> > > @@ -45,6 +45,7 @@ evas_common_init(void)
> > >     evas_common_image_init();
> > >     evas_common_convert_init();
> > >     evas_common_scale_init();
> > > +   evas_common_scale_sample_init();
> > >     evas_common_rectangle_init();
> > >     evas_common_polygon_init();
> > >     evas_common_line_init();
> > > @@ -60,6 +61,7 @@ evas_common_shutdown(void)
> > >
> > >     evas_font_dir_cache_free();
> > >     evas_common_image_cache_free();
> > > +   evas_common_scale_sample_shutdown();
> > >  }
> > >
> > >  EAPI void
> > > diff --git a/src/lib/evas/common/evas_scale_main.h
> > > b/src/lib/evas/common/evas_scale_main.h
> > > index c0e1f94..76c46c8 100644
> > > --- a/src/lib/evas/common/evas_scale_main.h
> > > +++ b/src/lib/evas/common/evas_scale_main.h
> > > @@ -4,6 +4,8 @@
> > >  typedef Eina_Bool (*Evas_Common_Scale_In_To_Out_Clip_Cb)(RGBA_Image
> *src,
> > > RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int
> src_region_y,
> > > int src_region_w, int src_region_h, int dst_region_x, int dst_region_y,
> int
> > > dst_region_w, int dst_region_h);
> > >
> > >  EAPI void evas_common_scale_init                            (void);
> > > +EAPI void evas_common_scale_sample_init                     (void);
> > > +EAPI void evas_common_scale_sample_shutdown                 (void);
> > >
> > >  EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_cb
> > > (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int
> src_region_x,
> > > int src_region_y, int src_region_w, int src_region_h, int dst_region_x,
> int
> > > dst_region_y, int dst_region_w, int dst_region_h,
> > > Evas_Common_Scale_In_To_Out_Clip_Cb cb);
> > >  EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_smooth
> > > (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int
> src_region_x,
> > > int src_region_y, int src_region_w, int src_region_h, int dst_region_x,
> int
> > > dst_region_y, int dst_region_w, int dst_region_h);
> > > diff --git a/src/lib/evas/common/evas_scale_sample.c
> > > b/src/lib/evas/common/evas_scale_sample.c
> > > index 940ccba..09a0631 100644
> > > --- a/src/lib/evas/common/evas_scale_sample.c
> > > +++ b/src/lib/evas/common/evas_scale_sample.c
> > > @@ -3,6 +3,42 @@
> > >
> > >  static Eina_Bool scale_rgba_in_to_out_clip_sample_internal(RGBA_Image
> > > *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int
> > > src_region_y, int src_region_w, int src_region_h, int dst_region_x, int
> > > dst_region_y, int dst_region_w, int dst_region_h);
> > >
> > > +typedef struct _Evas_Scale_Thread Evas_Scale_Thread;
> > > +typedef struct _Evas_Scale_Msg Evas_Scale_Msg;
> > > +
> > > +struct _Evas_Scale_Msg
> > > +{
> > > +   Eina_Thread_Queue_Msg head;
> > > +   Evas_Scale_Thread *task;
> > > +};
> > > +
> > > +struct _Evas_Scale_Thread
> > > +{
> > > +   RGBA_Image *mask8;
> > > +   DATA32 **row_ptr;
> > > +   DATA32 *dptr;
> > > +   int *lin_ptr;
> > > +
> > > +   RGBA_Gfx_Func func;
> > > +   RGBA_Gfx_Func func2;
> > > +
> > > +   int dst_clip_x;
> > > +   int dst_clip_y;
> > > +   int dst_clip_h;
> > > +   int dst_clip_w;
> > > +   int dst_w;
> > > +
> > > +   int mask_x;
> > > +   int mask_y;
> > > +
> > > +   unsigned int mul_col;
> > > +};
> > > +
> > > +static Eina_Bool use_thread = EINA_FALSE;
> > > +static Eina_Thread scaling_thread;
> > > +static Eina_Thread_Queue *thread_queue = NULL;
> > > +static Eina_Thread_Queue *main_queue = NULL;
> > > +
> > >  EAPI Eina_Bool
> > >  evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src,
> RGBA_Image
> > > *dst,
> > >                                               RGBA_Draw_Context *dc,
> > > @@ -58,6 +94,80 @@
> evas_common_scale_rgba_in_to_out_clip_sample_do(const
> > > Cutout_Rects *reuse,
> > >       }
> > >  }
> > >
> > > +static void
> > > +_evas_common_scale_rgba_sample_scale_nomask(int y,
> > > +                                            int dst_clip_w, int
> > > dst_clip_h, int dst_w,
> > > +                                            DATA32 **row_ptr, int
> > > *lin_ptr,
> > > +                                            DATA32 *dptr,
> RGBA_Gfx_Func
> > > func, unsigned int mul_col)
> > > +{
> > > +   DATA32 *buf, *dst_ptr;
> > > +   int x;
> > > +
> > > +   /* a scanline buffer */
> > > +   buf = alloca(dst_clip_w * sizeof(DATA32));
> > > +
> > > +   dptr = dptr + dst_w * y;
> > > +   for (; y < dst_clip_h; y++)
> > > +     {
> > > +        dst_ptr = buf;
> > > +        for (x = 0; x < dst_clip_w; x++)
> > > +          {
> > > +             DATA32 *ptr;
> > > +
> > > +             ptr = row_ptr[y] + lin_ptr[x];
> > > +             *dst_ptr = *ptr;
> > > +             dst_ptr++;
> > > +          }
> > > +
> > > +        /* * blend here [clip_w *] buf -> dptr * */
> > > +        func(buf, NULL, mul_col, dptr, dst_clip_w);
> > > +
> > > +        dptr += dst_w;
> > > +     }
> > > +}
> > > +
> > > +static void
> > > +_evas_common_scale_rgba_sample_scale_mask(int y,
> > > +                                          int dst_clip_x, int
> dst_clip_y,
> > > +                                          int dst_clip_w, int
> dst_clip_h,
> > > int dst_w,
> > > +                                          int mask_x, int mask_y,
> > > +                                          DATA32 **row_ptr, int
> *lin_ptr,
> > > RGBA_Image *im,
> > > +                                          DATA32 *dptr, RGBA_Gfx_Func
> > > func, RGBA_Gfx_Func func2,
> > > +                                          unsigned int mul_col)
> > > +{
> > > +   DATA32 *buf, *dst_ptr;
> > > +   int x;
> > > +
> > > +   /* a scanline buffer */
> > > +   buf = alloca(dst_clip_w * sizeof(DATA32));
> > > +
> > > +   dptr = dptr + dst_w * y;
> > > +   for (; y < dst_clip_h; y++)
> > > +     {
> > > +        DATA8 *mask;
> > > +
> > > +        dst_ptr = buf;
> > > +        mask = im->image.data8
> > > +          + ((dst_clip_y - mask_y + y) * im->cache_entry.w)
> > > +          + (dst_clip_x - mask_x);
> > > +
> > > +        for (x = 0; x < dst_clip_w; x++)
> > > +          {
> > > +             DATA32 *ptr;
> > > +
> > > +             ptr = row_ptr[y] + lin_ptr[x];
> > > +             *dst_ptr = *ptr;
> > > +             dst_ptr++;
> > > +          }
> > > +
> > > +        /* * blend here [clip_w *] buf -> dptr * */
> > > +        if (mul_col != 0xFFFFFFFF) func2(buf, NULL, mul_col, buf,
> > > dst_clip_w);
> > > +        func(buf, mask, 0, dptr, dst_clip_w);
> > > +
> > > +        dptr += dst_w;
> > > +     }
> > > +}
> > > +
> > >  EAPI void
> > >  evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst,
> int
> > > dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32
> mul_col,
> > > int render_op, int src_region_x, int src_region_y, int src_region_w,
> int
> > > src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int
> > > dst_region_h, RGBA_Image *mask_ie, int mask_x, int mask_y)
> > >  {
> > > @@ -587,51 +697,83 @@
> scale_rgba_in_to_out_clip_sample_internal(RGBA_Image
> > > *src, RGBA_Image *dst,
> > >          else
> > >  #endif
> > >            {
> > > +             unsigned int mul_col;
> > > +
> > >               /* a scanline buffer */
> > >               buf = alloca(dst_clip_w * sizeof(DATA32));
> > >
> > > -             /* image masking */
> > > -             if (dc->clip.mask)
> > > -               {
> > > -                  RGBA_Image *im = dc->clip.mask;
> > > +             mul_col = dc->mul.use ? dc->mul.col : 0xFFFFFFFF;
> > >
> > > -                  for (y = 0; y < dst_clip_h; y++)
> > > +             /* do we have enough data to start some additional thread
> ?
> > > */
> > > +             if (use_thread && dst_clip_h > 32 && dst_clip_w *
> dst_clip_h
> > > > 4096)
> > > +               {
> > > +                  /* Yes, we do ! */
> > > +                  Evas_Scale_Msg *msg;
> > > +                  void *ref;
> > > +                  Evas_Scale_Thread local;
> > > +
> > > +                  local.mask8 = dc->clip.mask;
> > > +                  local.row_ptr = row_ptr;
> > > +                  local.dptr = dptr;
> > > +                  local.lin_ptr = lin_ptr;
> > > +                  local.func = func;
> > > +                  local.func2 = func2;
> > > +                  local.dst_clip_x = dst_clip_x;
> > > +                  local.dst_clip_y = dst_clip_y;
> > > +                  local.dst_clip_h = dst_clip_h;
> > > +                  local.dst_clip_w = dst_clip_w;
> > > +                  local.dst_w = dst_w;
> > > +                  local.mask_x = dc->clip.mask_x;
> > > +                  local.mask_y = dc->clip.mask_y;
> > > +                  local.mul_col = mul_col;
> > > +
> > > +                  msg = eina_thread_queue_send(thread_queue, sizeof
> > > (Evas_Scale_Msg), &ref);
> > > +                  msg->task = &local;
> > > +                  eina_thread_queue_send_done(thread_queue, ref);
> > > +
> > > +                  /* image masking */
> > > +                  if (dc->clip.mask)
> > >                      {
> > > -                       dst_ptr = buf;
> > > -                       mask = im->image.data8
> > > -                          + ((dst_clip_y - dc->clip.mask_y + y) *
> > > im->cache_entry.w)
> > > -                          + (dst_clip_x - dc->clip.mask_x);
> > > -
> > > -                       for (x = 0; x < dst_clip_w; x++)
> > > -                         {
> > > -                            ptr = row_ptr[y] + lin_ptr[x];
> > > -                            *dst_ptr = *ptr;
> > > -                            dst_ptr++;
> > > -                         }
> > > -
> > > -                       /* * blend here [clip_w *] buf -> dptr * */
> > > -                       if (dc->mul.use) func2(buf, NULL, dc->mul.col,
> > > buf, dst_clip_w);
> > > -                       func(buf, mask, 0, dptr, dst_clip_w);
> > > +                       _evas_common_scale_rgba_sample_scale_mask(0,
> > > +
> > >  dst_clip_x, dst_clip_y,
> > > +
> > >  dst_clip_w, dst_clip_h >> 1, dst_w,
> > > +
> > >  dc->clip.mask_x, dc->clip.mask_y,
> > > +
>  row_ptr,
> > > lin_ptr, dc->clip.mask,
> > > +                                                                 dptr,
> > > func, func2, mul_col);
> > >
> > > -                       dptr += dst_w;
> > >                      }
> > > +                  else
> > > +                    {
> > > +                       _evas_common_scale_rgba_sample_scale_nomask(0,
> > > +
> > >  dst_clip_w, dst_clip_h >> 1, dst_w,
> > > +
> > >  row_ptr, lin_ptr,
> > > +
>  dptr,
> > > func, mul_col);
> > > +                    }
> > > +
> > > +                  msg = eina_thread_queue_wait(main_queue, &ref);
> > > +                  if (msg) eina_thread_queue_wait_done(main_queue,
> ref);
> > >                 }
> > >               else
> > >                 {
> > > -                  for (y = 0; y < dst_clip_h; y++)
> > > -                    {
> > > -                       dst_ptr = buf;
> > > -                       for (x = 0; x < dst_clip_w; x++)
> > > -                         {
> > > -                            ptr = row_ptr[y] + lin_ptr[x];
> > > -                            *dst_ptr = *ptr;
> > > -                            dst_ptr++;
> > > -                         }
> > > +                  /* No we don't ! */
> > >
> > > -                       /* * blend here [clip_w *] buf -> dptr * */
> > > -                       func(buf, NULL, dc->mul.col, dptr, dst_clip_w);
> > > +                  /* image masking */
> > > +                  if (dc->clip.mask)
> > > +                    {
> > > +                       _evas_common_scale_rgba_sample_scale_mask(0,
> > > +
> > >  dst_clip_x, dst_clip_y,
> > > +
> > >  dst_clip_w, dst_clip_h, dst_w,
> > > +
> > >  dc->clip.mask_x, dc->clip.mask_y,
> > > +
>  row_ptr,
> > > lin_ptr, dc->clip.mask,
> > > +                                                                 dptr,
> > > func, func2, mul_col);
> > >
> > > -                       dptr += dst_w;
> > > +                    }
> > > +                  else
> > > +                    {
> > > +                       _evas_common_scale_rgba_sample_scale_nomask(0,
> > > +
> > >  dst_clip_w, dst_clip_h, dst_w,
> > > +
> > >  row_ptr, lin_ptr,
> > > +
>  dptr,
> > > func, mul_col);
> > >                      }
> > >                 }
> > >            }
> > > @@ -639,3 +781,95 @@
> scale_rgba_in_to_out_clip_sample_internal(RGBA_Image
> > > *src, RGBA_Image *dst,
> > >
> > >     return EINA_TRUE;
> > >  }
> > > +
> > > +static void *
> > > +_evas_common_scale_sample_thread(void *data EINA_UNUSED,
> > > +                                 Eina_Thread t EINA_UNUSED)
> > > +{
> > > +   Evas_Scale_Msg *msg;
> > > +   Evas_Scale_Thread *todo = NULL;
> > > +
> > > +   do
> > > +     {
> > > +        void *ref;
> > > +
> > > +        todo = NULL;
> > > +
> > > +        msg = eina_thread_queue_wait(thread_queue, &ref);
> > > +        if (msg)
> > > +          {
> > > +             int h;
> > > +
> > > +             todo = msg->task;
> > > +             eina_thread_queue_wait_done(thread_queue, &ref);
> > > +
> > > +             if (!todo) goto end;
> > > +
> > > +             h = todo->dst_clip_h >> 1;
> > > +
> > > +             if (todo->mask8)
> > > +               _evas_common_scale_rgba_sample_scale_mask(h,
> > > +
> > >  todo->dst_clip_x, todo->dst_clip_y,
> > > +
> > >  todo->dst_clip_w, todo->dst_clip_h,
> > > +                                                         todo->dst_w,
> > > +                                                         todo->mask_x,
> > > todo->mask_y,
> > > +
>  todo->row_ptr,
> > > todo->lin_ptr, todo->mask8,
> > > +                                                         todo->dptr,
> > > todo->func, todo->func2,
> > > +
>  todo->mul_col);
> > > +             else
> > > +               _evas_common_scale_rgba_sample_scale_nomask(h,
> > > +
> > >  todo->dst_clip_w, todo->dst_clip_h,
> > > +
>  todo->dst_w,
> > > +
>  todo->row_ptr,
> > > todo->lin_ptr,
> > > +                                                           todo->dptr,
> > > todo->func, todo->mul_col);
> > > +          }
> > > +
> > > +     end:
> > > +        msg = eina_thread_queue_send(main_queue, sizeof
> (Evas_Scale_Msg),
> > > &ref);
> > > +        msg->task = NULL;
> > > +        eina_thread_queue_send_done(main_queue, ref);
> > > +     }
> > > +   while (todo);
> > > +
> > > +   return NULL;
> > > +}
> > > +
> > > +EAPI void
> > > +evas_common_scale_sample_init(void)
> > > +{
> > > +   if (eina_cpu_count() <= 2) return ;
> > > +
> > > +   thread_queue = eina_thread_queue_new();
> > > +   main_queue = eina_thread_queue_new();
> > > +
> > > +   if (!eina_thread_create(&scaling_thread, EINA_THREAD_NORMAL, -1,
> > > +                           _evas_common_scale_sample_thread, NULL))
> > > +     {
> > > +        return;
> > > +     }
> > > +
> > > +   use_thread = EINA_TRUE;
> > > +}
> > > +
> > > +EAPI void
> > > +evas_common_scale_sample_shutdown(void)
> > > +{
> > > +   Evas_Scale_Msg *msg;
> > > +   void *ref;
> > > +
> > > +   if (!use_thread) return ;
> > > +
> > > +   msg = eina_thread_queue_send(thread_queue, sizeof (Evas_Scale_Msg),
> > > &ref);
> > > +   msg->task = NULL;
> > > +   eina_thread_queue_send_done(thread_queue, ref);
> > > +
> > > +   /* Here is the thread commiting succide*/
> > > +
> > > +   msg = eina_thread_queue_wait(main_queue, &ref);
> > > +   if (msg) eina_thread_queue_wait_done(main_queue, ref);
> > > +
> > > +   eina_thread_join(scaling_thread);
> > > +
> > > +   eina_thread_queue_free(thread_queue);
> > > +   eina_thread_queue_free(main_queue);
> > > +}
> > >
> > > --
> > >
> > >
> > >
> >
>
> ------------------------------------------------------------------------------
> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> > with Interactivity, Sharing, Native Excel Exports, App Integration & more
> > Get technology previously reserved for billion-dollar corporations, FREE
> >
>
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to