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 /thread.c | |
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
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); } |