mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Now calling pthread_cond_broadcast() in the desctructor of cCondWait and cCondVar; using pthread_cond_broadcast() instead of pthread_cond_signal() in cCondWait
This commit is contained in:
		
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -3089,3 +3089,7 @@ Video Disk Recorder Revision History | |||||||
| - Immediately displaying the new channel info when switching channel groups. | - Immediately displaying the new channel info when switching channel groups. | ||||||
| - Moved the main program loop variables further up to allow compilation with | - Moved the main program loop variables further up to allow compilation with | ||||||
|   older compiler versions (thanks to Marco Schl<68><6C>ler for reporting this one). |   older compiler versions (thanks to Marco Schl<68><6C>ler for reporting this one). | ||||||
|  | - Now calling pthread_cond_broadcast() in the desctructor of cCondWait and | ||||||
|  |   cCondVar to make sure any sleepers will wake up (suggested by Werner Fink). | ||||||
|  |   Also using pthread_cond_broadcast() instead of pthread_cond_signal() in | ||||||
|  |   cCondWait, in case there is more than one sleeper. | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								thread.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								thread.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * how to reach the author. | ||||||
|  * |  * | ||||||
|  * $Id: thread.c 1.35 2004/10/24 11:05:56 kls Exp $ |  * $Id: thread.c 1.36 2004/10/31 09:54:02 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "thread.h" | #include "thread.h" | ||||||
| @@ -28,6 +28,7 @@ cCondWait::cCondWait(void) | |||||||
|  |  | ||||||
| cCondWait::~cCondWait() | cCondWait::~cCondWait() | ||||||
| { | { | ||||||
|  |   pthread_cond_broadcast(&cond); // wake up any sleepers | ||||||
|   pthread_cond_destroy(&cond); |   pthread_cond_destroy(&cond); | ||||||
|   pthread_mutex_destroy(&mutex); |   pthread_mutex_destroy(&mutex); | ||||||
| } | } | ||||||
| @@ -71,7 +72,7 @@ void cCondWait::Signal(void) | |||||||
| { | { | ||||||
|   pthread_mutex_lock(&mutex); |   pthread_mutex_lock(&mutex); | ||||||
|   signaled = true; |   signaled = true; | ||||||
|   pthread_cond_signal(&cond); |   pthread_cond_broadcast(&cond); | ||||||
|   pthread_mutex_unlock(&mutex); |   pthread_mutex_unlock(&mutex); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -84,6 +85,7 @@ cCondVar::cCondVar(void) | |||||||
|  |  | ||||||
| cCondVar::~cCondVar() | cCondVar::~cCondVar() | ||||||
| { | { | ||||||
|  |   pthread_cond_broadcast(&cond); // wake up any sleepers | ||||||
|   pthread_cond_destroy(&cond); |   pthread_cond_destroy(&cond); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user