Class MacOSThread
java.lang.Object
oshi.software.common.AbstractOSThread
oshi.software.common.os.mac.MacOSThread
- All Implemented Interfaces:
OSThread
OSThread implementation
-
Nested Class Summary
Nested classes/interfaces inherited from interface OSThread
OSThread.ThreadFilteringModifier and TypeInterfaceDescriptionstatic final classConstants which may be used to filter Thread lists -
Constructor Summary
ConstructorsConstructorDescriptionMacOSThread(int processId) Creates a MacOSThread with just a process ID.MacOSThread(int pid, int threadId, OSProcess.State state, long kernelTime, long userTime, long startTime, long upTime, int priority) Creates a MacOSThread with full parameters. -
Method Summary
Modifier and TypeMethodDescriptionlongKernel (privileged) time used by the thread.intPriority of the thread, the meaning of which is dependent on the OS.longThe start time of the thread.getState()Gets the execution state of the task/thread.intThe thread id.longElapsed/up-time of the thread.longUser time used by the thread.Methods inherited from class AbstractOSThread
getOwningProcessId, getThreadCpuLoadBetweenTicks, getThreadCpuLoadCumulative, toStringModifier and TypeMethodDescriptionintThe owning process of this thread.doublegetThreadCpuLoadBetweenTicks(OSThread priorSnapshot) Gets CPU usage of this thread since a previous snapshot of the same thread, provided as a parameter.doubleGets cumulative CPU usage of this thread.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OSThread
getContextSwitches, getMajorFaults, getMinorFaults, getName, getStartMemoryAddress, updateAttributesModifier and TypeMethodDescriptiondefault longA snapshot of the context switches the thread has done.default longThe number of major (hard) faults the thread has made which have required loading a memory page from disk.default longThe number of minor (soft) faults the thread has made which have not required loading a memory page from disk.default StringgetName()The name of the thread.default longThe memory address above which this thread can run.default booleanAttempts to updates process attributes.
-
Constructor Details
-
MacOSThread
public MacOSThread(int pid, int threadId, OSProcess.State state, long kernelTime, long userTime, long startTime, long upTime, int priority) Creates a MacOSThread with full parameters.- Parameters:
pid- the process IDthreadId- the thread IDstate- the thread statekernelTime- kernel timeuserTime- user timestartTime- start timeupTime- up timepriority- the priority
-
MacOSThread
public MacOSThread(int processId) Creates a MacOSThread with just a process ID.- Parameters:
processId- the process ID
-
-
Method Details
-
getThreadId
public int getThreadId()Description copied from interface:OSThreadThe thread id. The meaning of this value is OS-dependent.- Returns:
- Returns the id of the thread.
-
getState
Description copied from interface:OSThreadGets the execution state of the task/thread.- Returns:
- Returns the execution state of the task/thread.
-
getKernelTime
public long getKernelTime()Description copied from interface:OSThreadKernel (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:OSThreadUser 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:OSThreadThe 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:OSThreadElapsed/up-time of the thread.- Returns:
- Returns the number of milliseconds since the task/thread started.
-
getPriority
public int getPriority()Description copied from interface:OSThreadPriority of the thread, the meaning of which is dependent on the OS.- Returns:
- priority.
-