mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-10-29 05:40:25 -04:00 
			
		
		
		
	snd_pcm_dmix_close: raise semaphore if unable to discard
This patch causes snd_pcm_dmix_close() to up a semaphore after downing it if it is unable to discard it. It prevents some deadlock that I am getting when a couple of applications interact and one of them closes the device and later re-opens it. From: Mike Gorse <mgorse@mgorse.dhs.org>
This commit is contained in:
		
							parent
							
								
									c2e368e7f7
								
							
						
					
					
						commit
						d6093c58f3
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -652,9 +652,10 @@ static int snd_pcm_dmix_close(snd_pcm_t *pcm) | ||||||
|  	if (dmix->client) |  	if (dmix->client) | ||||||
|  		snd_pcm_direct_client_discard(dmix); |  		snd_pcm_direct_client_discard(dmix); | ||||||
|  	shm_sum_discard(dmix); |  	shm_sum_discard(dmix); | ||||||
| 	if (snd_pcm_direct_shm_discard(dmix)) | 	if (snd_pcm_direct_shm_discard(dmix)) { | ||||||
| 		snd_pcm_direct_semaphore_discard(dmix); | 		if (snd_pcm_direct_semaphore_discard(dmix)) | ||||||
| 	else | 			snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); | ||||||
|  | 	} else | ||||||
| 		snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); | 		snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); | ||||||
| 	free(dmix->bindings); | 	free(dmix->bindings); | ||||||
| 	pcm->private_data = NULL; | 	pcm->private_data = NULL; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Takashi Iwai
						Takashi Iwai