mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	thread-mainloop: use recursive mutex
This commit is contained in:
		
							parent
							
								
									f5dbdbc0df
								
							
						
					
					
						commit
						618f5ec2b2
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -80,6 +80,7 @@ pinos_thread_main_loop_new (PinosLoop  *loop,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  PinosThreadMainLoopImpl *impl;
 | 
					  PinosThreadMainLoopImpl *impl;
 | 
				
			||||||
  PinosThreadMainLoop *this;
 | 
					  PinosThreadMainLoop *this;
 | 
				
			||||||
 | 
					  pthread_mutexattr_t attr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  impl = calloc (1, sizeof (PinosThreadMainLoopImpl));
 | 
					  impl = calloc (1, sizeof (PinosThreadMainLoopImpl));
 | 
				
			||||||
  this = &impl->this;
 | 
					  this = &impl->this;
 | 
				
			||||||
| 
						 | 
					@ -96,7 +97,10 @@ pinos_thread_main_loop_new (PinosLoop  *loop,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pinos_signal_init (&this->destroy_signal);
 | 
					  pinos_signal_init (&this->destroy_signal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pthread_mutex_init (&impl->lock, NULL);
 | 
					
 | 
				
			||||||
 | 
					  pthread_mutexattr_init (&attr);
 | 
				
			||||||
 | 
					  pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
 | 
				
			||||||
 | 
					  pthread_mutex_init (&impl->lock, &attr);
 | 
				
			||||||
  pthread_cond_init (&impl->cond, NULL);
 | 
					  pthread_cond_init (&impl->cond, NULL);
 | 
				
			||||||
  pthread_cond_init (&impl->accept_cond, NULL);
 | 
					  pthread_cond_init (&impl->accept_cond, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue