diff options
author | Werner Koch <wk@gnupg.org> | 2014-01-09 19:14:09 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-01-16 17:23:21 +0100 |
commit | cfc151ba637200e4fc05d9481a8df2071b2f9a47 (patch) | |
tree | f1a1c3e1fc81663d622dd5189462a249bd01eac3 /src/global.c | |
parent | 49edeebb43174865cf4fa2c170a42a8e4274c4f0 (diff) | |
download | libgcrypt-cfc151ba637200e4fc05d9481a8df2071b2f9a47.tar.gz |
Replace ath based mutexes by gpgrt based locks.
* configure.ac (NEED_GPG_ERROR_VERSION): Require 1.13.
(gl_LOCK): Remove.
* src/ath.c, src/ath.h: Remove. Remove from all files. Replace all
mutexes by gpgrt based statically initialized locks.
* src/global.c (global_init): Remove ath_init.
(_gcry_vcontrol): Make ath install a dummy function.
(print_config): Remove threads info line.
* doc/gcrypt.texi: Simplify the multi-thread related documentation.
--
The current code does only work on ELF systems with weak symbol
support. In particular no locks were used under Windows. With the
new gpgrt_lock functions from the soon to be released libgpg-error
1.13 we have a better portable scheme which also allows for static
initialized mutexes.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/global.c')
-rw-r--r-- | src/global.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/global.c b/src/global.c index 9af499e2..b2b1de6e 100644 --- a/src/global.c +++ b/src/global.c @@ -2,7 +2,7 @@ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 * 2004, 2005, 2006, 2008, 2011, * 2012 Free Software Foundation, Inc. - * Copyright (C) 2013 g10 Code GmbH + * Copyright (C) 2013, 2014 g10 Code GmbH * * This file is part of Libgcrypt. * @@ -38,7 +38,7 @@ #include "cipher.h" #include "stdmem.h" /* our own memory allocator */ #include "secmem.h" /* our own secmem allocator */ -#include "ath.h" + @@ -86,14 +86,6 @@ global_init (void) /* Tell the random module that we have seen an init call. */ _gcry_set_preferred_rng_type (0); - /* Initialize our portable thread/mutex wrapper. */ - err = ath_init (); - if (err) - { - err = gpg_error_from_errno (err); - goto fail; - } - /* See whether the system is in FIPS mode. This needs to come as early as possible but after ATH has been initialized. */ _gcry_initialize_fips_mode (force_fips_mode); @@ -304,7 +296,6 @@ print_config ( int (*fnc)(FILE *fp, const char *format, ...), FILE *fp) #endif ":\n"); fnc (fp, "mpi-asm:%s:\n", _gcry_mpi_get_hw_config ()); - fnc (fp, "threads:%s:\n", ath_get_model (NULL)); hwfeatures = _gcry_get_hw_features (); fnc (fp, "hwflist:"); for (i=0; (s = _gcry_enum_hw_features (i, &afeature)); i++) @@ -476,10 +467,10 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) break; case GCRYCTL_SET_THREAD_CBS: + /* This is now a dummy call. We used to install our own thread + library here. */ _gcry_set_preferred_rng_type (0); - rc = ath_install (va_arg (arg_ptr, void *)); - if (!rc) - global_init (); + global_init (); break; case GCRYCTL_FAST_POLL: |