Class WindowsOSThread
java.lang.Object
oshi.software.common.AbstractOSThread
oshi.software.common.os.windows.WindowsOSThread
- All Implemented Interfaces:
OSThread
Common base class for Windows OS thread implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface OSThread
OSThread.ThreadFiltering -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindowsOSThread(int pid, int tid, String procName, ThreadPerfCounterBlock pcb) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionlongA snapshot of the context switches the thread has done.longKernel (privileged) time used by the thread.getName()The name of the thread.intPriority of the thread, the meaning of which is dependent on the OS.protected StringReturns the process name prefix used for thread name construction.longThe memory address above which this thread can run.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.protected booleanupdateAttributes(String procName, ThreadPerfCounterBlock pcb) Updates thread attributes from a performance counter block.Methods inherited from class AbstractOSThread
getOwningProcessId, getThreadCpuLoadBetweenTicks, getThreadCpuLoadCumulative, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OSThread
getMajorFaults, getMinorFaults, updateAttributes
-
Constructor Details
-
WindowsOSThread
Constructor.- Parameters:
pid- the pidtid- the tidprocName- the procNamepcb- the pcb
-
-
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.
-
getName
-
getState
Description copied from interface:OSThreadGets the execution state of the task/thread.- Returns:
- Returns the execution state of the task/thread.
-
getStartMemoryAddress
public long getStartMemoryAddress()Description copied from interface:OSThreadThe memory address above which this thread can run.- Returns:
- The start address.
-
getContextSwitches
public long getContextSwitches()Description copied from interface:OSThreadA snapshot of the context switches the thread has done. Since the context switches could be voluntary and non-voluntary, this gives the sum of both.Not available on AIX.
- Returns:
- sum of both voluntary and involuntary context switches.
-
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.
-
getProcName
Returns the process name prefix used for thread name construction.- Returns:
- the process name (portion before "/" in the thread name)
-
updateAttributes
Updates thread attributes from a performance counter block.- Parameters:
procName- the owning process namepcb- the thread performance counter block, or null if unavailable- Returns:
- true if the thread is valid after the update
-