On Wed, 17 Oct 2012 07:37:42 +0200 Vincent Torri <[email protected]> said:

> On Wed, Oct 17, 2012 at 5:55 AM, Enlightenment SVN
> <[email protected]> wrote:
> > Log:
> > add eina barrier stuff.
> >
> >
> >
> > Author:       raster
> > Date:         2012-10-16 20:55:24 -0700 (Tue, 16 Oct 2012)
> > New Revision: 78099
> > Trac:         http://trac.enlightenment.org/e/changeset/78099
> >
> > Added:
> >   trunk/eina/src/include/eina_inline_lock_barrier.x
> > Modified:
> >   trunk/eina/configure.ac trunk/eina/m4/common/efl_threads.m4
> > trunk/eina/src/include/Makefile.am trunk/eina/src/include/eina_config.h.in
> > trunk/eina/src/include/eina_inline_lock_posix.x
> > trunk/eina/src/include/eina_inline_lock_void.x
> > trunk/eina/src/include/eina_inline_lock_win32.x
> > trunk/eina/src/include/eina_inline_lock_wince.x
> > trunk/eina/src/include/eina_lock.h
> >
> > Modified: trunk/eina/configure.ac
> > ===================================================================
> > --- trunk/eina/configure.ac     2012-10-17 02:43:50 UTC (rev 78098)
> > +++ trunk/eina/configure.ac     2012-10-17 03:55:24 UTC (rev 78099)
> > @@ -104,7 +104,11 @@
> >  if ! test "x${efl_have_threads}" = "xno" ; then
> >     EINA_CONFIGURE_HAVE_THREADS="#define EINA_HAVE_THREADS"
> >  fi
> > +if ! test "x${efl_have_pthread_barrier}" = "xno" ; then
> > +   EINA_CONFIGURE_HAVE_PTHREAD_BARRIER="#define EINA_HAVE_PTHREAD_BARRIER"
> > +fi
> >  AC_SUBST(EINA_CONFIGURE_HAVE_THREADS)
> > +AC_SUBST(EINA_CONFIGURE_HAVE_PTHREAD_BARRIER)
> >  AM_CONDITIONAL([EINA_HAVE_THREADS], [! test "x${efl_have_threads}" =
> > "xno"])
> >
> >  if test "x${efl_have_debug_threads}" = "xyes"; then
> > @@ -616,6 +620,7 @@
> >  echo "  Thread Support.......: ${efl_have_threads}"
> >  if test "${efl_have_threads}" = "POSIX" ; then
> >  echo "    spinlock...........: ${efl_have_posix_threads_spinlock}"
> > +echo "    barrier............: ${efl_have_pthread_barrier}"
> >  echo "    debug usage........: ${efl_have_debug_threads}"
> >  echo "    on/off support.....: ${efl_have_on_off_threads}"
> >  fi
> >
> > Modified: trunk/eina/m4/common/efl_threads.m4
> > ===================================================================
> > --- trunk/eina/m4/common/efl_threads.m4 2012-10-17 02:43:50 UTC (rev 78098)
> > +++ trunk/eina/m4/common/efl_threads.m4 2012-10-17 03:55:24 UTC (rev 78099)
> > @@ -64,6 +64,16 @@
> >         EFL_PTHREAD_LIBS=${_efl_threads_libs}
> >        ],
> >        [_efl_have_posix_threads="no"])
> > +   AC_LINK_IFELSE(
> > +      [AC_LANG_PROGRAM([[
> > +#include <pthread.h>
> > +                       ]],
> > +                       [[
> > +pthread_barrier_t barrier;
> > +pthread_barrier_init(&barrier, NULL, 1);
> > +                       ]])],
> > +      [efl_have_pthread_barrier="yes"],
> > +      [efl_have_pthread_barrier="no"])
> >     CFLAGS=${SAVE_CFLAGS}
> >     LIBS=${SAVE_LIBS}
> >
> > @@ -75,8 +85,10 @@
> >  else
> >     if test "x${_efl_have_win32_threads}" = "xyes" ; then
> >        efl_have_threads="Windows"
> > +      efl_have_pthread_barrier="no"
> >     else
> >        efl_have_threads="no"
> > +      efl_have_pthread_barrier="no"
> >     fi
> >  fi
> >  AC_MSG_RESULT([${efl_have_threads}])
> >
> > Modified: trunk/eina/src/include/Makefile.am
> > ===================================================================
> > --- trunk/eina/src/include/Makefile.am  2012-10-17 02:43:50 UTC (rev 78098)
> > +++ trunk/eina/src/include/Makefile.am  2012-10-17 03:55:24 UTC (rev 78099)
> > @@ -64,7 +64,8 @@
> >  eina_mmap.h \
> >  eina_xattr.h \
> >  eina_value.h \
> > -eina_inline_value.x
> > +eina_inline_value.x \
> > +eina_inline_lock_barrier.x
> >
> >  # Will be back for developper after 1.2.
> >  # eina_model.h
> >
> > Modified: trunk/eina/src/include/eina_config.h.in
> > ===================================================================
> > --- trunk/eina/src/include/eina_config.h.in     2012-10-17 02:43:50 UTC
> > (rev 78098) +++ trunk/eina/src/include/eina_config.h.in     2012-10-17
> > 03:55:24 UTC (rev 78099) @@ -58,6 +58,11 @@
> >  #endif
> >  @EINA_CONFIGURE_HAVE_THREADS@
> >
> > +#ifdef EINA_HAVE_PTHREAD_BARRIER
> > +# undef EINA_HAVE_PTHREAD_BARRIER
> > +#endif
> > +@EINA_CONFIGURE_HAVE_PTHREAD_BARRIER@
> > +
> >  #ifdef EINA_HAVE_DEBUG_THREADS
> >  # undef EINA_HAVE_DEBUG_THREADS
> >  #endif
> >
> > Modified: trunk/eina/src/include/eina_inline_lock_posix.x
> > ===================================================================
> > --- trunk/eina/src/include/eina_inline_lock_posix.x     2012-10-17 02:43:50
> > UTC (rev 78098) +++ trunk/eina/src/include/eina_inline_lock_posix.x
> > 2012-10-17 03:55:24 UTC (rev 78099) @@ -544,4 +544,38 @@
> >     return (sem_post(sem) == 0) ? EINA_TRUE : EINA_FALSE;
> >  }
> >
> > +#ifdef EINA_HAVE_PTHREAD_BARRIER
> > +typedef struct _Eina_Barrier Eina_Barrier;
> 
> why not directly
> 
> typedef pthread_barrier_t Eina_Barrier;
> 
> ?

i don't think it makes much of a difference and this follows consistency for
other eina thread things. if we want to add debugging then we need this
anyway. i dind't add any because i don't have anything to debug atm... so it
may as well be like it is and if we want debugging... add into the struct etc.
before the next release.

> Vincent
> 
> > +
> > +struct _Eina_Barrier
> > +{
> > +   pthread_barrier_t barrier;
> > +};
> > +
> > +static inline Eina_Bool
> > +eina_barrier_new(Eina_Barrier *barrier, int needed)
> > +{
> > +   if (!pthread_barrier_init(&(barrier->barrier), NULL, needed))
> > +     return EINA_TRUE;
> > +   return EINA_FALSE;
> > +}
> > +
> > +static inline void
> > +eina_barrier_free(Eina_Barrier *barrier)
> > +{
> > +   pthread_barrier_destroy(&(barrier->barrier));
> > +}
> > +
> > +static inline Eina_Bool
> > +eina_barrier_wait(Eina_Barrier *barrier)
> > +{
> > +   pthread_barrier_wait(&(barrier->barrier));
> > +   return EINA_TRUE;
> > +}
> > +
> > +#else
> > +#include "eina_inline_lock_barrier.x"
> >  #endif
> > +
> > +
> > +#endif
> >
> > Modified: trunk/eina/src/include/eina_inline_lock_void.x
> > ===================================================================
> > --- trunk/eina/src/include/eina_inline_lock_void.x      2012-10-17 02:43:50
> > UTC (rev 78098) +++ trunk/eina/src/include/eina_inline_lock_void.x
> > 2012-10-17 03:55:24 UTC (rev 78099) @@ -257,6 +257,8 @@
> >     return EINA_TRUE;
> >  }
> >
> > +#include "eina_inline_lock_barrier.x"
> > +
> >  /**
> >   * @}
> >   */
> >
> > Modified: trunk/eina/src/include/eina_inline_lock_win32.x
> > ===================================================================
> > --- trunk/eina/src/include/eina_inline_lock_win32.x     2012-10-17 02:43:50
> > UTC (rev 78098) +++ trunk/eina/src/include/eina_inline_lock_win32.x
> > 2012-10-17 03:55:24 UTC (rev 78099) @@ -551,4 +551,6 @@
> >     return ReleaseSemaphore(*sem, count_release, NULL) ? EINA_TRUE :
> > EINA_FALSE; }
> >
> > +#include "eina_inline_lock_barrier.x"
> > +
> >  #endif
> >
> > Modified: trunk/eina/src/include/eina_inline_lock_wince.x
> > ===================================================================
> > --- trunk/eina/src/include/eina_inline_lock_wince.x     2012-10-17 02:43:50
> > UTC (rev 78098) +++ trunk/eina/src/include/eina_inline_lock_wince.x
> > 2012-10-17 03:55:24 UTC (rev 78099) @@ -204,4 +204,6 @@
> >     return EINA_FALSE;
> >  }
> >
> > +#include "eina_inline_lock_barrier.x"
> > +
> >  #endif
> >
> > Modified: trunk/eina/src/include/eina_lock.h
> > ===================================================================
> > --- trunk/eina/src/include/eina_lock.h  2012-10-17 02:43:50 UTC (rev 78098)
> > +++ trunk/eina/src/include/eina_lock.h  2012-10-17 03:55:24 UTC (rev 78099)
> > @@ -110,6 +110,14 @@
> >  /** @relates static Eina_Bool eina_semaphore_release(sem_t *sem, int
> > count_release) */ static inline Eina_Bool eina_semaphore_release
> > (Eina_Semaphore *sem, int count_release);
> >
> > +/** @relates static Eina_Bool eina_barrier_new(Eina_Barrier *barrier, int
> > needed) @since 1.8 */ +static inline Eina_Bool eina_barrier_new
> > (Eina_Barrier *barrier, int needed); +/** @relates static void
> > eina_barrier_free(Eina_Barrier *barrier); @since 1.8 */ +static inline void
> > eina_barrier_free(Eina_Barrier *barrier); +/** @relates static Eina_Bool
> > eina_barrier_wait(Eina_Barrier *barrier); @since 1.8 */ +static inline
> > Eina_Bool eina_barrier_wait(Eina_Barrier *barrier); +
> > +
> >  #ifdef EINA_HAVE_DEBUG_THREADS
> >  # define EINA_MAIN_LOOP_CHECK_RETURN_VAL(val)                          \
> >    do {                                                                 \
> >
> >
> > ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_sfd2d_oct
> > _______________________________________________
> > enlightenment-svn mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [email protected]


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to