mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	don't assume that pa_asyncq_new() always succeeds
Bug 96741 shows a case where an assertion is hit, because pa_asyncq_new() failed due to running out of file descriptors. pa_asyncq_new() is used in only one place (not counting the call in asyncq-test): pa_asyncmsgq_new(). Now pa_asyncmsgq_new() can fail too, which requires error handling in many places. One of those places is pa_thread_mq_init(), which can now fail too, and that needs additional error handling in many more places. Luckily there weren't any places where adding better error handling wouldn't have been easy, so there are many changes in this patch, but they are not complicated. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96741
This commit is contained in:
		
							parent
							
								
									3e52972c61
								
							
						
					
					
						commit
						60695e3d84
					
				
					 27 changed files with 205 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -1525,7 +1525,11 @@ static int start_thread(struct userdata *u) {
 | 
			
		|||
    pa_assert(!u->rtpoll_item);
 | 
			
		||||
 | 
			
		||||
    u->rtpoll = pa_rtpoll_new();
 | 
			
		||||
    pa_thread_mq_init(&u->thread_mq, u->core->mainloop, u->rtpoll);
 | 
			
		||||
 | 
			
		||||
    if (pa_thread_mq_init(&u->thread_mq, u->core->mainloop, u->rtpoll) < 0) {
 | 
			
		||||
        pa_log("pa_thread_mq_init() failed.");
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(u->thread = pa_thread_new("bluetooth", thread_func, u))) {
 | 
			
		||||
        pa_log_error("Failed to create IO thread");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue