Permalink
Browse files

Use thread lock around fribidi calls (#4048,#4044)

closes #4044
closes #4048
  • Loading branch information...
1 parent f8445a2 commit 31916420b8de26126453f5beee481df0906f4e2e @tbonfort tbonfort committed Sep 21, 2012
Showing with 8 additions and 2 deletions.
  1. +7 −2 mapstring.c
  2. +1 −0 mapthread.h
View
@@ -1608,8 +1608,13 @@ char *msGetEncodedString(const char *string, const char *encoding)
size_t len, bufsize, bufleft, iconv_status;
#ifdef USE_FRIBIDI
- if(fribidi_parse_charset ((char*)encoding))
- return msGetFriBidiEncodedString(string, encoding);
+ msAcquireLock(TLOCK_FRIBIDI);
+ if(fribidi_parse_charset ((char*)encoding)) {
+ int ret = msGetFriBidiEncodedString(string, encoding);
+ msReleaseLock(TLOCK_FRIBIDI);
+ return ret;
+ }
+ msReleaseLock(TLOCK_FRIBIDI);
#endif
len = strlen(string);
View
@@ -66,6 +66,7 @@ extern "C" {
#define TLOCK_DEBUGOBJ 13
#define TLOCK_OGR 14
#define TLOCK_TIME 15
+#define TLOCK_FRIBIDI 16
#define TLOCK_STATIC_MAX 20
#define TLOCK_MAX 100

0 comments on commit 3191642

Please sign in to comment.