revert openexr-2.4.0, breaks most builds, req cmake past baseline, bad configure...
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / libXft-2.3.2.patch1
1 diff -ur libXft-2.3.2.orig/src/xftdpy.c libXft-2.3.2/src/xftdpy.c
2 --- libXft-2.3.2.orig/src/xftdpy.c      2014-06-06 00:05:07.000000000 -0600
3 +++ libXft-2.3.2/src/xftdpy.c   2017-10-17 08:55:30.227746279 -0600
4 @@ -22,6 +22,11 @@
5  
6  #include "xftint.h"
7  
8 +#include <pthread.h>
9 +static pthread_mutex_t info_mutex = PTHREAD_MUTEX_INITIALIZER;
10 +static inline void info_lock() { pthread_mutex_lock(&info_mutex); }
11 +static inline void info_unlock() { pthread_mutex_unlock(&info_mutex); }
12 +
13  _X_HIDDEN XftDisplayInfo       *_XftDisplayInfo;
14  
15  static int
16 @@ -48,10 +53,12 @@
17      /*
18       * Unhook from the global list
19       */
20 +    info_lock();
21      for (prev = &_XftDisplayInfo; (info = *prev); prev = &(*prev)->next)
22         if (info->display == dpy)
23             break;
24      *prev = info->next;
25 +    info_unlock();
26  
27      free (info);
28      return 0;
29 @@ -66,6 +73,7 @@
30      int                        i;
31      int                        event_base, error_base;
32  
33 +    info_lock();
34      for (prev = &_XftDisplayInfo; (info = *prev); prev = &(*prev)->next)
35      {
36         if (info->display == dpy)
37 @@ -79,9 +87,12 @@
38                 info->next = _XftDisplayInfo;
39                 _XftDisplayInfo = info;
40             }
41 +           info_unlock();
42             return info;
43         }
44      }
45 +    info_unlock();
46 +
47      if (!createIfNecessary)
48         return NULL;
49  
50 @@ -157,8 +168,10 @@
51      }
52      info->fonts = NULL;
53  
54 +    info_lock();
55      info->next = _XftDisplayInfo;
56      _XftDisplayInfo = info;
57 +    info_unlock();
58  
59      info->glyph_memory = 0;
60      info->max_glyph_memory = XftDefaultGetInteger (dpy,
61 Only in libXft-2.3.2: tags