mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Now setting the thread name, so that it can be seen in 'top -H'
This commit is contained in:
		| @@ -1052,6 +1052,7 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi> | ||||
|  language | ||||
|  for fixing displaying the free disk space when entering the recordings menu where | ||||
|  the last replayed recording was in a subdirectory, and pressing Back | ||||
|  for setting the thread name, so that it can be seen in 'top -H' | ||||
|  | ||||
| Ralf Klueber <ralf.klueber@vodafone.com> | ||||
|  for reporting a bug in cutting a recording if there is only a single editing mark | ||||
|   | ||||
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -5743,6 +5743,8 @@ Video Disk Recorder Revision History | ||||
|   Nissl). | ||||
| - Improved logging system time changes to avoid problems on slow systems under | ||||
|   heavy load (suggested by Helmut Auer). | ||||
| - Now setting the thread name, so that it can be seen in 'top -H' (thanks to Rolf | ||||
|   Ahrenberg). | ||||
|  | ||||
| 2008-04-13: Version 1.6.0-1 | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								thread.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								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.64 2008/02/15 14:17:42 kls Exp $ | ||||
|  * $Id: thread.c 2.1 2008/04/13 11:53:56 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "thread.h" | ||||
| @@ -17,6 +17,7 @@ | ||||
| #include <sys/syscall.h> | ||||
| #include <sys/time.h> | ||||
| #include <sys/wait.h> | ||||
| #include <sys/prctl.h> | ||||
| #include <unistd.h> | ||||
| #include "tools.h" | ||||
|  | ||||
| @@ -239,8 +240,13 @@ void cThread::SetDescription(const char *Description, ...) | ||||
| void *cThread::StartThread(cThread *Thread) | ||||
| { | ||||
|   Thread->childThreadId = ThreadId(); | ||||
|   if (Thread->description) | ||||
|   if (Thread->description) { | ||||
|      dsyslog("%s thread started (pid=%d, tid=%d)", Thread->description, getpid(), Thread->childThreadId); | ||||
| #ifdef PR_SET_NAME | ||||
|      if (prctl(PR_SET_NAME, Thread->description, 0, 0, 0) < 0) | ||||
|         esyslog("%s thread naming failed (pid=%d, tid=%d)", Thread->description, getpid(), Thread->childThreadId); | ||||
| #endif | ||||
|      } | ||||
|   Thread->Action(); | ||||
|   if (Thread->description) | ||||
|      dsyslog("%s thread ended (pid=%d, tid=%d)", Thread->description, getpid(), Thread->childThreadId); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user