Next: , Previous: Preparation, Up: How to use GnuTLS in applications


7.2 Multi-Threaded Applications

Although the GnuTLS library is thread safe by design, some parts of Libgcrypt, such as the random generator, are not. Applications have to register callback functions to ensure proper locking in the sensitive parts of libgcrypt.

There are helper macros to help you properly initialize the libraries. Examples are shown below.