Package oshi.software.os.mac
Class MacOSThread
- java.lang.Object
-
- oshi.software.common.AbstractOSThread
-
- oshi.software.os.mac.MacOSThread
-
- All Implemented Interfaces:
OSThread
@ThreadSafe public class MacOSThread extends AbstractOSThread
OSThread implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oshi.software.os.OSThread
OSThread.ThreadFiltering
-
-
Field Summary
Fields Modifier and Type Field Description private long
kernelTime
private int
priority
private long
startTime
private OSProcess.State
state
private int
threadId
private long
upTime
private long
userTime
-
Constructor Summary
Constructors Constructor Description MacOSThread(int processId)
MacOSThread(int pid, int threadId, OSProcess.State state, long kernelTime, long userTime, long startTime, long upTime, int priority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getKernelTime()
Kernel (privileged) time used by the thread.int
getPriority()
Priority of the thread, the meaning of which is dependent on the OS.long
getStartTime()
The start time of the thread.OSProcess.State
getState()
Gets the execution state of the task/thread.int
getThreadId()
The thread id.long
getUpTime()
Elapsed/up-time of the thread.long
getUserTime()
User time used by the thread.-
Methods inherited from class oshi.software.common.AbstractOSThread
getOwningProcessId, getThreadCpuLoadBetweenTicks, getThreadCpuLoadCumulative, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface oshi.software.os.OSThread
getContextSwitches, getMajorFaults, getMinorFaults, getName, getStartMemoryAddress, updateAttributes
-
-
-
-
Field Detail
-
threadId
private final int threadId
-
state
private final OSProcess.State state
-
kernelTime
private final long kernelTime
-
userTime
private final long userTime
-
startTime
private final long startTime
-
upTime
private final long upTime
-
priority
private final int priority
-
-
Constructor Detail
-
MacOSThread
public MacOSThread(int pid, int threadId, OSProcess.State state, long kernelTime, long userTime, long startTime, long upTime, int priority)
-
MacOSThread
public MacOSThread(int processId)
-
-
Method Detail
-
getThreadId
public int getThreadId()
Description copied from interface:OSThread
The thread id. The meaning of this value is OS-dependent.- Returns:
- Returns the id of the thread.
-
getState
public OSProcess.State getState()
Description copied from interface:OSThread
Gets the execution state of the task/thread.- Returns:
- Returns the execution state of the task/thread.
-
getKernelTime
public long getKernelTime()
Description copied from interface:OSThread
Kernel (privileged) time used by the thread.- Returns:
- Returns the number of milliseconds the task/thread has executed in kernel/system mode.
-
getUserTime
public long getUserTime()
Description copied from interface:OSThread
User time used by the thread.- Returns:
- Returns the number of milliseconds the task/thread has executed in user mode.
-
getStartTime
public long getStartTime()
Description copied from interface:OSThread
The start time of the thread.- Returns:
- Returns the start time of the task/thread in number of milliseconds since January 1, 1970.
-
getUpTime
public long getUpTime()
Description copied from interface:OSThread
Elapsed/up-time of the thread.- Returns:
- Returns the number of milliseconds since the task/thread started.
-
getPriority
public int getPriority()
Description copied from interface:OSThread
Priority of the thread, the meaning of which is dependent on the OS.- Returns:
- priority.
-
-