diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:31:25 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:26 +0000 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch')
-rw-r--r-- | import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch new file mode 100644 index 000000000..ac48f68db --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch @@ -0,0 +1,116 @@ +Remove use of DIRECT_RECURSIVE_MUTEX_INITIALIZER its not portable +use portable way to initialize recursive mutex using pthread_once() and direct_recursive_mutex_init() + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Index: DirectFB-1.7.7/lib/direct/os/linux/glibc/mutex.h +=================================================================== +--- DirectFB-1.7.7.orig/lib/direct/os/linux/glibc/mutex.h ++++ DirectFB-1.7.7/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 + +Index: DirectFB-1.7.7/lib/direct/trace.c +=================================================================== +--- DirectFB-1.7.7.orig/lib/direct/trace.c ++++ DirectFB-1.7.7/lib/direct/trace.c +@@ -89,8 +89,15 @@ struct __D_DirectTraceBuffer { + /**************************************************************************************************/ + + static DirectLink *buffers; +-static DirectMutex buffers_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(buffers_lock); + ++static pthread_once_t buffers_lock_init_once = PTHREAD_ONCE_INIT; ++static DirectMutex buffers_lock; ++ ++static void ++buffers_lock_init( void ) ++{ ++ direct_recursive_mutex_init(&buffers_lock); ++} + /**************************************************************************************************/ + + __dfb_no_instrument_function__ +@@ -113,6 +120,7 @@ get_trace_buffer( void ) + + D_MAGIC_SET( buffer, DirectTraceBuffer ); + ++ pthread_once(&buffers_lock_init_once, buffers_lock_init); + direct_mutex_lock( &buffers_lock ); + direct_list_append( &buffers, &buffer->link ); + direct_mutex_unlock( &buffers_lock ); +@@ -138,8 +146,14 @@ typedef struct { + } SymbolTable; + + static DirectLink *tables = NULL; +-static DirectMutex tables_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(tables_lock); ++static pthread_once_t tables_lock_init_once = PTHREAD_ONCE_INIT; ++static DirectMutex tables_lock; + ++static void ++tables_lock_init( void ) ++{ ++ direct_recursive_mutex_init(&tabless_lock); ++} + + __dfb_no_instrument_function__ + static void +@@ -370,6 +384,7 @@ direct_trace_lookup_symbol( const char * + Symbol *symbol; + SymbolTable *table; + ++ pthread_once(&tables_lock_init_once, tables_lock_init); + direct_mutex_lock( &tables_lock ); + + table = find_table( filename ); +@@ -514,6 +529,7 @@ direct_trace_print_stacks() + DirectTraceBuffer *b; + DirectTraceBuffer *buffer = get_trace_buffer(); + ++ pthread_once(&buffers_lock_init_once, buffers_lock_init); + direct_mutex_lock( &buffers_lock ); + + if (buffer && buffer->level) +@@ -611,6 +627,7 @@ direct_trace_free_buffer( DirectTraceBuf + D_MAGIC_ASSERT( buffer, DirectTraceBuffer ); + + if (buffer->thread) { ++ pthread_once(&buffers_lock_init_once, buffers_lock_init); + direct_mutex_lock( &buffers_lock ); + direct_list_remove( &buffers, &buffer->link ); + direct_mutex_unlock( &buffers_lock ); +Index: DirectFB-1.7.7/src/directfb.c +=================================================================== +--- DirectFB-1.7.7.orig/src/directfb.c ++++ DirectFB-1.7.7/src/directfb.c +@@ -99,6 +99,15 @@ const unsigned int directfb_micro_versio + const unsigned int directfb_binary_age = DIRECTFB_BINARY_AGE; + const unsigned int directfb_interface_age = DIRECTFB_INTERFACE_AGE; + ++static pthread_once_t lock_init_once = PTHREAD_ONCE_INIT; ++static DirectMutex lock; ++ ++static void ++lock_init( void ) ++{ ++ direct_recursive_mutex_init(&lock); ++} ++ + const char * + DirectFBCheckVersion( unsigned int required_major, + unsigned int required_minor, +@@ -215,8 +224,7 @@ DirectFBCreate( IDirectFB **interface_pt + 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 ); + + if (!dfb_config->no_singleton && idirectfb_singleton) { |