[linux-audio-dev] GThread vs. pthread

Jack O'Quin joq at io.com
Sat Jun 12 05:09:05 UTC 2004


Pete Bessman <ninjadroid at gazuga.net> writes:

> One more point in favor of GThread I just figured out is config
> testing for it.  All you have to do is at a pkg-config check for
> gthread-2.0 and your set.  Having glanced through other programs,
> checking for pthreads seems a bit more involved than I care to be
> (read: not at all, I hate the fscking autotools).  So, I think
> I'll roll with GThread.

Not a very strong reason.  Checking for pthreads is a little tricky,
but hardly rocket science.  These checks (from JACK) work for quite a
few platforms, though I'm sure there are others one could add...

AC_CHECK_HEADER(/usr/include/nptl/pthread.h,
	[CFLAGS="$CFLAGS -I/usr/include/nptl"])

AC_CHECK_FUNC(pthread_create, [],
    AC_CHECK_LIB(pthread, pthread_create, [],
	AC_MSG_ERROR([*** JACK requires POSIX threads support])))

There is also a conditional check for pthread_barrier_init().
-- 
  joq



More information about the Linux-audio-dev mailing list