aboutsummaryrefslogtreecommitdiffstats
path: root/testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
diff options
context:
space:
mode:
authorClayton Craft <clayton@craftyguy.net>2017-09-28 18:10:49 -0700
committerWilliam Pitcock <nenolod@dereferenced.org>2017-10-01 07:25:43 +0000
commitcafcbbc290e76cee7c30091874a070e46eb34e7a (patch)
treea4182b74ba6daff605da26f194e580f35c787233 /testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
parentf12d98d4e03bf664864438ac113490a70a503e8e (diff)
downloadaports-cafcbbc290e76cee7c30091874a070e46eb34e7a.tar.gz
aports-cafcbbc290e76cee7c30091874a070e46eb34e7a.tar.bz2
aports-cafcbbc290e76cee7c30091874a070e46eb34e7a.tar.xz
testing/directfb: new aport
https://github.com/DirectFB/directfb Library for hw graphics acceleration, input dev, windowing system on top of the Linux fb device
Diffstat (limited to 'testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch')
-rw-r--r--testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch b/testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
new file mode 100644
index 0000000000..03b087fc2c
--- /dev/null
+++ b/testing/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
@@ -0,0 +1,47 @@
+--- a/lib/direct/os/linux/glibc/mutex.h
++++ b/lib/direct/os/linux/glibc/mutex.h
+@@ -46,7 +46,6 @@ struct __D_DirectMutex {
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
+
+ #endif
+
+--- a/lib/direct/trace.c
++++ b/lib/direct/trace.c
+@@ -89,7 +89,7 @@ struct __D_DirectTraceBuffer {
+ /**************************************************************************************************/
+
+ static DirectLink *buffers;
+-static DirectMutex buffers_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(buffers_lock);
++static DirectMutex buffers_lock = DIRECT_MUTEX_INITIALIZER(buffers_lock);
+
+ /**************************************************************************************************/
+
+--- a/src/directfb.c
++++ b/src/directfb.c
+@@ -163,6 +163,15 @@ DirectFBSetOption( const char *name, const char *value )
+ return DFB_OK;
+ }
+
++
++static pthread_once_t lock_init_once = PTHREAD_ONCE_INIT;
++static DirectMutex lock;
++
++static void lock_init(void)
++{
++ direct_recursive_mutex_init(&lock);
++}
++
+ /*
+ * Programs have to call this to get the super interface
+ * which is needed to access other functions
+@@ -215,7 +224,7 @@ DirectFBCreate( IDirectFB **interface_ptr )
+ if (dfb_config->remote.host)
+ return CreateRemote( dfb_config->remote.host, dfb_config->remote.port, interface_ptr );
+
+- static DirectMutex lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(lock);
++ pthread_once(&lock_init_once, lock_init);
+
+ direct_mutex_lock( &lock );