Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
941ad72f
Commit
941ad72f
authored
Nov 24, 2010
by
Hisham Muhammad
Browse files
correct thread detection
parent
831538b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ProcessList.c
View file @
941ad72f
...
...
@@ -557,13 +557,10 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
if
(
parent
&&
pid
==
parent
->
pid
)
continue
;
bool
isThread
=
parent
;
// The RedHat kernel hides threads with a dot.
// I believe this is non-standard.
if
((
!
this
->
hideThreads
)
&&
pid
==
0
&&
name
[
0
]
==
'.'
)
{
char
*
tname
=
name
+
1
;
pid
=
atoi
(
tname
);
isThread
=
true
;
pid
=
atoi
(
name
+
1
);
}
if
(
pid
<=
0
)
continue
;
...
...
@@ -593,7 +590,6 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
if
(
!
ProcessList_readStatmFile
(
process
,
dirname
,
name
))
goto
errorReadingProcess
;
isThread
=
Process_isThread
(
process
);
process
->
show
=
!
((
hideKernelThreads
&&
Process_isKernelThread
(
process
))
||
(
hideUserlandThreads
&&
Process_isUserlandThread
(
process
)));
char
command
[
MAX_NAME
+
1
];
...
...
@@ -629,7 +625,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
ProcessList_add
(
this
,
process
);
}
if
(
isThread
)
{
if
(
Process_isThread
(
process
)
)
{
if
(
this
->
showThreadNames
||
Process_isKernelThread
(
process
)
||
process
->
state
==
'Z'
)
{
free
(
process
->
comm
);
process
->
comm
=
String_copy
(
command
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment