*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ *
+ * Author: Stef Walter <stefw@thewalter.net>
*/
#include "config.h"
static int
glib_thread_mutex_init (void **lock)
{
- *lock = g_mutex_new ();
+ *lock = g_slice_new (GMutex);
+ g_mutex_init (*lock);
return 0;
}
static int
glib_thread_mutex_destroy (void **lock)
{
- g_mutex_free (*lock);
+ g_mutex_clear (*lock);
+ g_slice_free (GMutex, *lock);
return 0;
}
/* Only initialize libgcrypt if it hasn't already been initialized */
if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
- if (g_thread_supported())
- gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs);
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs);
gcry_check_version (LIBGCRYPT_VERSION);
gcry_set_log_handler (log_handler, NULL);
gcry_set_outofcore_handler (no_mem_handler, NULL);