mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	loop: blocking wait
Release the locks before waiting.
This commit is contained in:
		
							parent
							
								
									64d1307684
								
							
						
					
					
						commit
						ebd13a2a74
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -248,10 +248,15 @@ loop_invoke(struct spa_loop *loop,
 | 
			
		|||
 | 
			
		||||
		if (block) {
 | 
			
		||||
			uint64_t count = 1;
 | 
			
		||||
 | 
			
		||||
			spa_hook_list_call(&impl->hooks_list, struct spa_loop_control_hooks, before);
 | 
			
		||||
 | 
			
		||||
			if (read(impl->ack_fd, &count, sizeof(uint64_t)) != sizeof(uint64_t))
 | 
			
		||||
				spa_log_warn(impl->log, NAME " %p: failed to read event fd: %s",
 | 
			
		||||
						impl, strerror(errno));
 | 
			
		||||
 | 
			
		||||
			spa_hook_list_call(&impl->hooks_list, struct spa_loop_control_hooks, after);
 | 
			
		||||
 | 
			
		||||
			res = item->res;
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
| 
						 | 
				
			
			@ -740,7 +745,7 @@ impl_init(const struct spa_handle_factory *factory,
 | 
			
		|||
	spa_ringbuffer_init(&impl->buffer);
 | 
			
		||||
 | 
			
		||||
	impl->wakeup = spa_loop_utils_add_event(&impl->utils, wakeup_func, impl);
 | 
			
		||||
	impl->ack_fd = eventfd(0, EFD_CLOEXEC);
 | 
			
		||||
	impl->ack_fd = eventfd(0, EFD_SEMAPHORE | EFD_CLOEXEC);
 | 
			
		||||
 | 
			
		||||
	spa_log_debug(impl->log, NAME " %p: initialized", impl);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue