1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid warnings with g++ 4.1.0

This commit is contained in:
Klaus Schmidinger 2006-01-01 14:53:03 +01:00
parent 7d84ddefb3
commit dbc2abadd8
3 changed files with 11 additions and 3 deletions

View File

@ -1446,6 +1446,8 @@ Ville Skytt
for making LIRC command parsing more robust for making LIRC command parsing more robust
for fixing some typos in MANUAL for fixing some typos in MANUAL
for reporting that the default value for "Setup/EPG bugfix level" was wrong 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> Steffen Beyer <cpunk@reactor.de>
for fixing setting the colored button help after deleting a recording in case the next for fixing setting the colored button help after deleting a recording in case the next

View File

@ -4058,3 +4058,5 @@ Video Disk Recorder Revision History
- Removed unused variables in skinclassic.c and skinsttng.c (thanks to Marco - Removed unused variables in skinclassic.c and skinsttng.c (thanks to Marco
Schlüßler). Schlüßler).
- Made the static cControl functions thread safe (thanks to Patrick Fischer). - 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ä).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "thread.h"
@ -137,7 +137,9 @@ void cCondVar::Broadcast(void)
cRwLock::cRwLock(bool PreferWriter) 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); pthread_rwlock_init(&rwlock, &attr);
} }
@ -171,7 +173,9 @@ void cRwLock::Unlock(void)
cMutex::cMutex(void) cMutex::cMutex(void)
{ {
locked = 0; 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); pthread_mutex_init(&mutex, &attr);
} }