mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
backport of a thread bugfix from 2_5_X branch Daniel
* threads.c: backport of a thread bugfix from 2_5_X branch Daniel
This commit is contained in:
@ -235,8 +235,10 @@ xmlFreeRMutex(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
* xmlRMutexLock() is used to lock a libxml2 token_r.
|
||||
*/
|
||||
void
|
||||
xmlRMutexLock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
xmlRMutexLock(xmlRMutexPtr tok)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&tok->lock);
|
||||
if (tok->held) {
|
||||
@ -269,6 +271,8 @@ xmlRMutexLock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
void
|
||||
xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&tok->lock);
|
||||
tok->held--;
|
||||
|
Reference in New Issue
Block a user