winecoreaudio: Change to faster non-recursive mutex.

This commit is contained in:
Ken Thomases 2006-12-21 03:49:51 -06:00 committed by Alexandre Julliard
parent d5975872af
commit 3ade58b0b9
1 changed files with 1 additions and 7 deletions

View File

@ -438,7 +438,6 @@ LONG CoreAudio_WaveInit(void)
OSStatus status; OSStatus status;
UInt32 propertySize; UInt32 propertySize;
CHAR szPname[MAXPNAMELEN]; CHAR szPname[MAXPNAMELEN];
pthread_mutexattr_t mutexattr;
int i; int i;
HANDLE hThread; HANDLE hThread;
CFStringRef messageThreadPortName; CFStringRef messageThreadPortName;
@ -472,9 +471,6 @@ LONG CoreAudio_WaveInit(void)
CoreAudio_DefaultDevice.interface_name=HeapAlloc(GetProcessHeap(),0,strlen(CoreAudio_DefaultDevice.dev_name)+1); CoreAudio_DefaultDevice.interface_name=HeapAlloc(GetProcessHeap(),0,strlen(CoreAudio_DefaultDevice.dev_name)+1);
sprintf(CoreAudio_DefaultDevice.interface_name, "%s", CoreAudio_DefaultDevice.dev_name); sprintf(CoreAudio_DefaultDevice.interface_name, "%s", CoreAudio_DefaultDevice.dev_name);
pthread_mutexattr_init(&mutexattr);
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
for (i = 0; i < MAX_WAVEOUTDRV; ++i) for (i = 0; i < MAX_WAVEOUTDRV; ++i)
{ {
WOutDev[i].state = WINE_WS_CLOSED; WOutDev[i].state = WINE_WS_CLOSED;
@ -509,11 +505,9 @@ LONG CoreAudio_WaveInit(void)
WOutDev[i].caps.dwFormats |= WAVE_FORMAT_1M16; WOutDev[i].caps.dwFormats |= WAVE_FORMAT_1M16;
WOutDev[i].caps.dwFormats |= WAVE_FORMAT_1S16; WOutDev[i].caps.dwFormats |= WAVE_FORMAT_1S16;
pthread_mutex_init(&WOutDev[i].lock, &mutexattr); /* initialize the mutex */ pthread_mutex_init(&WOutDev[i].lock, NULL); /* initialize the mutex */
} }
pthread_mutexattr_destroy(&mutexattr);
/* create mach messages handler */ /* create mach messages handler */
srandomdev(); srandomdev();
messageThreadPortName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, messageThreadPortName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,