summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-04-10 14:08:26 +0200
committerBenBE <BenBE@geshi.org>2021-05-23 09:22:21 +0200
commit7224d0e0831ee53d5028915f87dffd51ffa0d6fa (patch)
treec193e41f03dd30cf414d427c5e4e71b127842d98 /Process.h
parent1a1fddae851b344b0a89a8f2753e2d2487f34064 (diff)
Move kernel/userland thread handling to platform-independent implementation
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Process.h b/Process.h
index 2a198441..f70ab571 100644
--- a/Process.h
+++ b/Process.h
@@ -110,6 +110,12 @@ typedef struct Process_ {
/* Foreground group identifier of the controlling terminal */
int tpgid;
+ /* This is a kernel (helper) task */
+ bool isKernelThread;
+
+ /* This is a userland thread / LWP */
+ bool isUserlandThread;
+
/* Controlling terminal identifier of the process */
unsigned long int tty_nr;
@@ -260,7 +266,6 @@ typedef struct ProcessFieldData_ {
void Process_writeField(const Process* this, RichString* str, ProcessField field);
int Process_compare(const void* v1, const void* v2);
void Process_delete(Object* cast);
-bool Process_isThread(const Process* this);
extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
#define PROCESS_MAX_PID_DIGITS 19
extern int Process_pidDigits;
@@ -290,6 +295,18 @@ static inline bool Process_isChildOf(const Process* this, pid_t pid) {
return pid == Process_getParentPid(this);
}
+static inline bool Process_isKernelThread(const Process *this) {
+ return this->isKernelThread;
+}
+
+static inline bool Process_isUserlandThread(const Process *this) {
+ return this->isUserlandThread;
+}
+
+static inline bool Process_isThread(const Process *this) {
+ return Process_isUserlandThread(this) || Process_isKernelThread(this);
+}
+
#define CMDLINE_HIGHLIGHT_FLAG_SEPARATOR 0x00000001
#define CMDLINE_HIGHLIGHT_FLAG_BASENAME 0x00000002
#define CMDLINE_HIGHLIGHT_FLAG_COMM 0x00000004

© 2014-2024 Faster IT GmbH | imprint | privacy policy