diff options
author | Ulrich Drepper <[email protected]> | 2008-08-16 03:09:13 +0000 |
---|---|---|
committer | Ulrich Drepper <[email protected]> | 2008-08-16 03:09:13 +0000 |
commit | d56e232fb8f8cd97a336ed612c89145ec121f785 (patch) | |
tree | 5bd8fe5f1f73bb258eecd2cd4dae5c30a33a016e /configure.ac | |
parent | 1d8bb25cac06b5af57f8733e5ea7a068a79edfe0 (diff) |
propagate from branch 'com.redhat.elfutils.pmachata.threads' (head 8bd3bc10eb015c96f7bafcc6a22c973620b57dd8)
to branch 'com.redhat.elfutils' (head c5a11b6b3329382f1b5ffd0020f0d93c64176f20)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index c883b8df..4008efda 100644 --- a/configure.ac +++ b/configure.ac @@ -50,7 +50,10 @@ AC_CANONICAL_HOST AC_ARG_ENABLE([tls], AS_HELP_STRING([--enable-tls], [enable use of thread local storage]), -AC_DEFINE(USE_TLS)) +use_tls=yes, use_tls=no) +AM_CONDITIONAL(USE_TLS, test "$use_tls" = yes) +AS_IF([test "$use_tls" = yes], [AC_DEFINE(USE_TLS)]) + AH_TEMPLATE([USE_TLS], [Defined if thread local storage should be used.]) dnl Add all the languages for which translations are available. @@ -226,6 +229,21 @@ AM_PO_SUBDIRS dnl Test of the config.h file. We hide all kinds of configuration magic dnl in there. AH_BOTTOM([ +#ifdef USE_TLS +# include <pthread.h> +# define tls_key_t __thread void * +# define key_create(keyp, freefct) (1) +# define getspecific(key) key +# define setspecific(key,val) key = val +# define once_define(class,name) class struct { } name +# define once_execute(name,fct) ((void) &name, (void) (fct)) +# define rwlock_define(class,name) class pthread_rwlock_t name +# define rwlock_init(lock) pthread_rwlock_init (&lock, NULL) +# define rwlock_fini(lock) pthread_rwlock_destroy (&lock) +# define rwlock_rdlock(lock) pthread_rwlock_rdlock (&lock) +# define rwlock_wrlock(lock) pthread_rwlock_wrlock (&lock) +# define rwlock_unlock(lock) pthread_rwlock_unlock (&lock) +#else /* Eventually we will allow multi-threaded applications to use the libraries. Therefore we will add the necessary locking although the macros used expand to nothing for now. */ @@ -247,6 +265,7 @@ AH_BOTTOM([ fct (); \ name = 1; \ } while (0) +#endif /* gettext helper macro. */ #define N_(Str) Str |