* evas: fix fribidi race condition (perhaps not the right way) with thread rendering.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Mar 2010 11:06:54 +0000 (11:06 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Mar 2010 11:06:54 +0000 (11:06 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@47418 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_intl_utils.c

index 3395995..90ccfcb 100644 (file)
@@ -9,6 +9,10 @@
 
 #define UTF8_BYTES_PER_CHAR 4
 
+#ifdef BUILD_PTHREAD
+static LK(fribidi_lock);
+#endif
+
 /* FIXME: fribidi_utf8_to_unicode should use char len and not byte len!*/
 char *
 evas_intl_utf8_to_visual(const char *text,
@@ -87,12 +91,15 @@ evas_intl_utf8_to_visual(const char *text,
    /* fix arabic context */
    evas_intl_arabic_to_context(unicode_in);
 #endif
+   LKL(fribidi_lock);
    if (!fribidi_log2vis(unicode_in, len, direction,
          unicode_out, tmp_L_to_V_list, tmp_V_to_L_list, tmp_level_list))
      {
+        LKU(fribidi_lock);
        len = -2;
        goto error5;
      }
+   LKU(fribidi_lock);
 
    text_out = malloc(UTF8_BYTES_PER_CHAR * len + 1);
    if (!text_out)