Full_Name: Ryan Tandy
Submission from: (NULL) (18.104.22.168)
Submitted by: ryan
The GnuTLS documentation
> Do not call this function from a library, or preferably from any application
unless really needed to.
Additionally, the custom mutex functions are never reset, so if
unloaded (for example via dlclose()) after calling this, its code may be
unmapped and the application could crash when GnuTLS calls the mutex functions.
On typical systems, GnuTLS system mutexes are probably the same as what libldap
This is not a safe assumption on Windows, unfortunately. While libldap uses native
Windows mutexes on Windows, a lot of code built using gcc/g++ uses a posixthreads
emulation library for thread and mutex support, and the user-visible structures are
not compatible with native mutexes. (I've found this to be a significant problem
for g++ std::mutex, std::thread, etc.)
The attached patch file is derived from OpenLDAP Software. All of the
modifications to OpenLDAP Software represented in the following patch were
developed by Ryan Tandy <ryan(a)nardis.ca>. I have not assigned rights and/or
interest in this work to any party.
I, Ryan Tandy, hereby place the following modifications to OpenLDAP Software
(and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose with or
without attribution and/or other notice.
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/