aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2016-11-08 14:32:14 +0000
committerAndre Heinecke <[email protected]>2016-11-10 12:33:13 +0000
commit09b64554328445e99a8cc78fc34ea49c2ea2e7f9 (patch)
treef5d68498f7b5b099a62486c45ce5aa23ee6445d3 /doc
parentpython: Require at least GPGME 1.7 for out-of-tree builds. (diff)
downloadgpgme-09b64554328445e99a8cc78fc34ea49c2ea2e7f9.tar.gz
gpgme-09b64554328445e99a8cc78fc34ea49c2ea2e7f9.zip
core: Use gpgrt locking for thread safeness
* configure.ac: Require libgpg-error 1.17. No longer check for pthread. * doc/gpgme.texi: Document removed neccessity for thread safe gpgme flavours. * src/sema.h (DEFINE_GLOBAL_LOCK), (DEFINE_STATIC_LOCK, INIT_LOCK, DECLARE_LOCK) (DESTROY_LOCK, LOCK, UNLOCK): Change to gpgrt equivalents. * src/posix-sema.c, src/w32-sema.c: Removed. * src/Makefile.am: Remove libpthread and Update accordingly. * src/ath.c, src/ath.h (ath_mutex_init) (ath_mutex_destroy, ath_mutex_lock, ath_mutex_unlock): Removed. * src/ath.h (ATH_MUTEX_INITIALIZER): Removed. * src/version.c (do_subsystem_inits): sema_subsystem_init is no longer required. * tests/gpg/Makefile.am: Add new threading tests. (t_thread1_LDADD, t_cancel_LDADD): Use just gpgme. * tests/gpg/t-thread-keylist-verify.c, tests/gpg/t-thread-keylist.c: New. * src/gpgme-config.in: Use -lgpgme for thread-model pthread. -- Using gpgrt locks instead of pthread locks removes the neccessity to link pthread directly to gpgme and have a different, thread safe flavor of gpgme. Now gpgme is thread-safe if the conditions mentioned in the doc are met. As the cpp bindings linked against libgpgme and not libgpgme-pthread this fixes threading problems with them. libgpgme-pthread is removed but gpgme-config still supports --thread=pthread for compatibility with find scripts.
Diffstat (limited to 'doc')
-rw-r--r--doc/gpgme.texi36
1 files changed, 6 insertions, 30 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index a70418db..42c16a89 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -458,12 +458,6 @@ specifying both options to @command{gpgme-config}:
gcc -o foo foo.c `gpgme-config --cflags --libs`
@end example
-If you want to link to one of the thread-safe versions of
-@acronym{GPGME}, you must specify the @option{--thread} option before
-any other option to select the thread package you want to link with.
-Supported thread packages are @option{--thread=pth} and
-@option{--thread=pthread}.
-
If you need to detect the installed language bindings you can use list
them using:
@@ -614,7 +608,9 @@ that can be used with GNU Pth, and defines @code{GPGME_PTH_CFLAGS} and
@code{AM_PATH_GPGME_PTHREAD} checks for the version of @acronym{GPGME}
that can be used with the native pthread implementation, and defines
-@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}.
+@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since
+version 1.8.0 this is no longer required to GPGME_PTHREAD as
+@acronym{GPGME} itself is thread safe.
This macro searches for @command{gpgme-config} along the PATH. If
you are cross-compiling, it is useful to set the environment variable
@@ -814,32 +810,12 @@ application is multi-threaded, and you install a signal action for
@cindex thread-safeness
@cindex multi-threading
-The @acronym{GPGME} library is not entirely thread-safe, but it can
-still be used in a multi-threaded environment if some care is taken.
-If the following requirements are met, there should be no race
-conditions to worry about:
+The @acronym{GPGME} library is mostly thread-safe, an can be used
+in a mulithreaded environment but there are some requirements
+for mutlithreaded use:
@itemize @bullet
@item
-@acronym{GPGME} supports the thread libraries pthread and GNU Pth.
-The support for this has to be enabled at compile time.
-@acronym{GPGME} will automatically detect the location in which the
-thread libraries are installed and activate the support for them at
-build time.
-
-Support for other thread libraries is very easy to add. Please
-contact us if you have the need.
-
-@item
-If you want to use @acronym{GPGME} with threads, you must link to the
-right version of the library. The name of the right library is
-@code{libgpgme-} followed by the name of the thread package you use.
-For example, if you use GNU Pth, the right name is
-@code{libgpgme-pth}. Use the Automake macros or
-@command{gpgme-config} program for simplicity.
-
-
-@item
The function @code{gpgme_check_version} must be called before any
other function in the library, because it initializes the thread
support subsystem in @acronym{GPGME}. To achieve this in