thread-safety when used by a library

Werner Koch wk at
Thu Dec 13 11:35:04 CET 2012

On Thu, 13 Dec 2012 01:25, phajdan.jr at said:

> Could you share a general plan how would you like to deal with that issue?

This has already been fixed in Libgcrypt master.  There are still the
usual problems with libraries and pthreads left (e.g. the not 100%
solvable problems with fork and pthread).

One think I am still thinking about is to use semaphores instead of
mutex.  They don't have the pthread problems and are sufficient for
Libgcrypt purposes.  The only drawback I can see is the requirement to
link against librt.  nPth uses semaphores so at least for GnuPG 2.1 it
is a link dependency anyway.

> Would you accept patches to get things fully fixed?

Yes.  See doc/HACKING.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gcrypt-devel mailing list