mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	The function cThread::Cancel() now only sets 'running' to false and does not actually kill the thread if the special value -1 is given
This commit is contained in:
		| @@ -1468,6 +1468,8 @@ Udo Richter <udo_richter@gmx.de> | ||||
|  for reporting a problem with cPlugin::ConfigDirectory() in case a plugin calls it | ||||
|  from a separate thread | ||||
|  for reporting that an assignment in svdrp.c didn't use the cTimer::operator=()) | ||||
|  for suggesting that the function cThread::Cancel() should only set 'running' to | ||||
|  false and not actually kill the thread if the special value -1 is given | ||||
|  | ||||
| Sven Kreiensen <svenk@kammer.uni-hannover.de> | ||||
|  for his help in keeping 'channels.conf.terr' up to date | ||||
|   | ||||
							
								
								
									
										5
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -4930,3 +4930,8 @@ Video Disk Recorder Revision History | ||||
| 2006-09-23: Version 1.4.3 | ||||
|  | ||||
| - Official release. | ||||
|  | ||||
| 2006-09-24: Version 1.4.3-1 | ||||
|  | ||||
| - The function cThread::Cancel() now only sets 'running' to false and does not | ||||
|   actually kill the thread if the special value -1 is given (suggested by Udo Richter). | ||||
|   | ||||
							
								
								
									
										4
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								config.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: config.h 1.271 2006/09/23 13:56:08 kls Exp $ | ||||
|  * $Id: config.h 1.272 2006/09/24 10:09:25 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #ifndef __CONFIG_H | ||||
| @@ -21,7 +21,7 @@ | ||||
|  | ||||
| // VDR's own version number: | ||||
|  | ||||
| #define VDRVERSION  "1.4.3" | ||||
| #define VDRVERSION  "1.4.3-1" | ||||
| #define VDRVERSNUM   10403  // Version * 10000 + Major * 100 + Minor | ||||
|  | ||||
| // The plugin API's version number: | ||||
|   | ||||
							
								
								
									
										4
									
								
								thread.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								thread.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: thread.c 1.57 2006/08/20 10:20:44 kls Exp $ | ||||
|  * $Id: thread.c 1.58 2006/09/24 12:54:47 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "thread.h" | ||||
| @@ -293,7 +293,7 @@ bool cThread::Active(void) | ||||
| void cThread::Cancel(int WaitSeconds) | ||||
| { | ||||
|   running = false; | ||||
|   if (active) { | ||||
|   if (active && WaitSeconds > -1) { | ||||
|      if (WaitSeconds > 0) { | ||||
|         for (time_t t0 = time(NULL) + WaitSeconds; time(NULL) < t0; ) { | ||||
|             if (!Active()) | ||||
|   | ||||
							
								
								
									
										4
									
								
								thread.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								thread.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: thread.h 1.36 2006/01/08 11:40:23 kls Exp $ | ||||
|  * $Id: thread.h 1.37 2006/09/24 10:10:37 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #ifndef __THREAD_H | ||||
| @@ -103,6 +103,8 @@ protected: | ||||
|        ///< the Action() loop can finish in an orderly fashion and then waiting | ||||
|        ///< up to WaitSeconds seconds for the thread to actually end. If the | ||||
|        ///< thread doesn't end by itself, it is killed. | ||||
|        ///< If WaitSeconds is -1, only 'running' is set to false and Cancel() | ||||
|        ///< returns immediately, without killing the thread. | ||||
| public: | ||||
|   cThread(const char *Description = NULL); | ||||
|        ///< Creates a new thread. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user