pub struct ThreadInfo { /* private fields */ }Expand description
One row of thread_report — what C’s epicsThreadShowInfo prints about
one thread (os/Linux/osdThreadExtra.c:31-55).
Implementations§
Source§impl ThreadInfo
impl ThreadInfo
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The NAME column: std::thread::current().name(), or noname for a
thread spawned without one — C’s own placeholder for the same case
(osdThread.c:601).
Sourcepub fn epics_priority(&self) -> u8
pub fn epics_priority(&self) -> u8
The OSIPRI column: the EPICS priority, 0..=99.
Sourcepub fn os_priority(&self) -> i32
pub fn os_priority(&self) -> i32
The OSSPRI column: the OS scheduling priority the thread runs at.
C reads this live with pthread_getschedparam (osdThreadExtra.c:39).
This recomputes it from the outcome the prologue recorded, through the
same map that produced it, which is the same number: nothing in this
workspace re-bands a thread after the prologue
(only_the_prologue_reaches_the_banding_call), and the map’s other
input — the probed range — is fixed for the life of the process.
Any outcome but PriorityApplied::Realtime left the thread on the
default policy, whose sched_priority is 0 by POSIX. That is what C’s
live read returns for those threads too, and what a non-privileged
Linux IOC shows in this column for every row.
Sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
C epicsThreadIsSuspended (osdThread.c:910-914) — the STATE
column’s source, and what C’s iocsh epicsThreadResume tests before
it acts (libComRegister.c:445).
Sourcepub fn resume(&self) -> bool
pub fn resume(&self) -> bool
C epicsThreadResume (osdThread.c:797-802) on this thread.
false means it was not suspended, which is the arm C’s iocsh
wrapper reports as Thread %s is not suspended
(libComRegister.c:445-449).
Sourcepub fn show_line(&self) -> String
pub fn show_line(&self) -> String
The row epicsThreadShowInfo prints, without its newline.
%16.16s %14p %8lu %3d%8d %8.8s%s on Linux, %12lu for the OS id
elsewhere. The trailing %s is C’s ZOMBIE marker, for a thread
whose function has returned but whose epicsThreadOSD is still
referenced; it is always empty here because the row and the thread end
together.
The %8.8s state column is C’s isSuspended ? "SUSPEND" : "OK"
(os/Linux/osdThreadExtra.c:48-52), read live from the cell the
thread’s own suspend_self blocks on.
Trait Implementations§
Source§impl Clone for ThreadInfo
impl Clone for ThreadInfo
Source§fn clone(&self) -> ThreadInfo
fn clone(&self) -> ThreadInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more