1
0
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:
Daniel Veillard
2003-09-11 23:35:09 +00:00
parent c6e20e44dd
commit 5f1e1f8a87
3 changed files with 200 additions and 192 deletions

View File

@ -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--;