From 300dfeb2c43c7b0b21cb57726128b43c970eb78d Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 3 Jul 2013 18:35:21 +0000 Subject: Make it clear that there are three separate internal locks. --- lib/libc/iconv/citrus_csmapper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libc/iconv/citrus_csmapper.c') diff --git a/lib/libc/iconv/citrus_csmapper.c b/lib/libc/iconv/citrus_csmapper.c index 5e0a01a..e2d10d5 100644 --- a/lib/libc/iconv/citrus_csmapper.c +++ b/lib/libc/iconv/citrus_csmapper.c @@ -58,6 +58,8 @@ static struct _citrus_mapper_area *maparea = NULL; +static pthread_rwlock_t ma_lock = PTHREAD_RWLOCK_INITIALIZER; + #define CS_ALIAS _PATH_CSMAPPER "/charset.alias" #define CS_PIVOT _PATH_CSMAPPER "/charset.pivot" @@ -314,7 +316,7 @@ get_none(struct _citrus_mapper_area *__restrict ma, { int ret; - WLOCK; + WLOCK(&ma_lock); if (csm_none) { *rcsm = csm_none; ret = 0; @@ -329,7 +331,7 @@ get_none(struct _citrus_mapper_area *__restrict ma, *rcsm = csm_none; ret = 0; quit: - UNLOCK; + UNLOCK(&ma_lock); return (ret); } -- cgit v1.1