diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-01 14:53:03 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-01 14:53:03 +0100 |
commit | dbc2abadd8e604d5f4009a11d823df43c0a6a621 (patch) | |
tree | b1b64729f8d763866334be694d6294b5396ba1df | |
parent | 7d84ddefb3fc3c1dab66864b114fdd85af18cd4e (diff) | |
download | vdr-dbc2abadd8e604d5f4009a11d823df43c0a6a621.tar.gz vdr-dbc2abadd8e604d5f4009a11d823df43c0a6a621.tar.bz2 |
Fixed initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid warnings with g++ 4.1.0
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | thread.c | 10 |
3 files changed, 11 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c1977138..23cffcdc 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1446,6 +1446,8 @@ Ville Skyttä <ville.skytta@iki.fi> for making LIRC command parsing more robust for fixing some typos in MANUAL for reporting that the default value for "Setup/EPG bugfix level" was wrong + for fixing initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid + warnings with g++ 4.1.0 Steffen Beyer <cpunk@reactor.de> for fixing setting the colored button help after deleting a recording in case the next @@ -4058,3 +4058,5 @@ Video Disk Recorder Revision History - Removed unused variables in skinclassic.c and skinsttng.c (thanks to Marco Schlüßler). - Made the static cControl functions thread safe (thanks to Patrick Fischer). +- Fixed initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid + warnings with g++ 4.1.0 (thanks to Ville Skyttä). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.c 1.47 2005/12/11 12:09:24 kls Exp $ + * $Id: thread.c 1.48 2006/01/01 14:50:44 kls Exp $ */ #include "thread.h" @@ -137,7 +137,9 @@ void cCondVar::Broadcast(void) cRwLock::cRwLock(bool PreferWriter) { - pthread_rwlockattr_t attr = { PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP }; + pthread_rwlockattr_t attr; + pthread_rwlockattr_init(&attr); + pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP); pthread_rwlock_init(&rwlock, &attr); } @@ -171,7 +173,9 @@ void cRwLock::Unlock(void) cMutex::cMutex(void) { locked = 0; - pthread_mutexattr_t attr = { PTHREAD_MUTEX_ERRORCHECK_NP }; + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP); pthread_mutex_init(&mutex, &attr); } |