[PATCH libX11 1/3] Make _XCloseLC thread safe.

Jacek Caban jacek at codeweavers.com
Mon Aug 14 17:18:32 UTC 2017


Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=55678
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68538
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69088
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
---
 src/xlibi18n/lcWrap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
index 38242608..43b4d622 100644
--- a/src/xlibi18n/lcWrap.c
+++ b/src/xlibi18n/lcWrap.c
@@ -324,6 +324,8 @@ _XCloseLC(
 {
     XLCdList cur, *prev;
 
+    _XLockMutex(_Xi18n_lock);
+
     for (prev = &lcd_list; (cur = *prev); prev = &cur->next) {
 	if (cur->lcd == lcd) {
 	    if (--cur->ref_count < 1) {
@@ -339,6 +341,8 @@ _XCloseLC(
 	_XlcDeInitLoader();
 	loader_list = NULL;
     }
+
+    _XUnlockMutex(_Xi18n_lock);
 }
 
 /*
-- 
2.13.0



More information about the xorg-devel mailing list