• Home
  • Raw
  • Download

Lines Matching full:thread

12 Thread Creation Backend
14 A backend for ``pw::thread::Thread`` is offered using ``tx_thread_create``.
16 thread's context.
19 allocated and passed in as an option. As a quick example, a detached thread can
31 pw::thread::threadx::config::kDefaultPriority;
33 pw::thread::threadx::config::kDefaultTimeSliceInterval;
35 pw::thread::threadx::config::kDefaultStackSizeWords;
37 pw::thread::threadx::ContextWithStack<kFooStackSizeWords>
40 pw::thread::DetachedThread(
41 pw::thread::threadx::Options()
56 - Thread identification.
59 - Thread scheduler yielding.
62 - Thread scheduler sleeping.
63 * - ``pw_thread:thread``
64 - ``pw_thread_threadx:thread``
65 - Thread creation.
76 Whether thread joining is enabled. By default this is disabled.
78 We suggest only enabling this when thread joining is required to minimize
81 Enabling this grows the RAM footprint of every pw::thread::Thread as it adds
82 a TX_EVENT_FLAGS_GROUP to every thread's pw::thread::threadx::Context. In
95 The maximum length of a thread's name, not including null termination. By
97 which is this length + 1 bytes in every pw::thread::Thread's context.
119 ThreadX Thread Options
121 .. cpp:class:: pw::thread::threadx::Options
125 Sets the name for the ThreadX thread, note that this will be deep copied
131 Sets the priority for the ThreadX thread from 0 through 31, where a value
139 Optionally sets the preemption threshold for the ThreadX thread from 0
143 preempt this thread. In other words this allows the thread to specify the
161 Sets the number of ticks this thread is allowed to run before other ready
168 this thread.
174 .. cpp:function:: set_context(pw::thread::embos::Context& context)
176 Set the pre-allocated context (all memory needed to run a thread). Note
177 that this is required for this thread creation backend! The Context can
183 Thread Identification Backend
185 A backend for ``pw::thread::Id`` and ``pw::thread::get_id()`` is offerred using
186 ``tx_thread_identify()``. It uses ``DASSERT`` to ensure that a thread is
190 Thread Sleep Backend
192 A backend for ``pw::thread::sleep_for()`` and ``pw::thread::sleep_until()`` is
195 ``pw::this_thread::get_id() != thread::Id()`` to ensure it invoked only from a
196 thread.
199 Thread Yield Backend
201 A backend for ``pw::thread::yield()`` is offered using via
203 ``pw::this_thread::get_id() != thread::Id()`` to ensure it invoked only from a
204 thread.
211 In cases where an operation must be performed for every thread,
212 ``ForEachThread()`` can be used to iterate over all the created thread TCBs.
216 ``false`` to request an early termination of thread iteration.
220 * ``Aborted``: The callback requested an early-termination of thread iteration.
221 * ``OkStatus``: The callback has been successfully run with every thread.
226 This ``pw_thread`` backend provides helper functions that capture ThreadX thread
227 state to a ``pw::thread::Thread`` proto.
231 ``SnapshotThread()`` captures the thread name, state, and stack information for
232 the provided ThreadX TCB to a ``pw::thread::Thread`` protobuf encoder. To ensure
234 running thread must be provided for cases where the running thread is being
242 pw::thread::ProcessThreadStackCallback cb =
243 [](pw::thread::proto::Thread::StreamEncoder& encoder,
247 pw::thread::threadx::SnapshotThread(my_thread, stack_ptr,
250 ``SnapshotThreads()`` wraps the singular thread capture to instead captures
251 all created threads to a ``pw::thread::proto::SnapshotThreadInfo`` message.
254 ``pw::thread::proto::SnapshotThreadInfo::StreamEncoder`` when calling this