Lines Matching refs:a
6 A :dfn:`stack` is a kernel object that implements a traditional
8 to add and remove a limited number of integer data values.
24 and must be aligned on a native word boundary.
32 A data value can be **added** to a stack by a thread or an ISR.
33 The value is given directly to a waiting thread, if one exists;
38 and prevent attempts to add a data value to a stack that has already reached
39 its maximum quantity of queued values. Adding a data value to a stack that is
42 A data value may be **removed** from a stack by a thread.
43 If the stack's queue is empty a thread may choose to wait for it to be given.
45 When a data item is added, it is given to the highest priority thread
49 The kernel does allow an ISR to remove an item from a stack, however
55 Defining a Stack
58 A stack is defined using a variable of type :c:struct:`k_stack`.
60 :c:func:`k_stack_alloc_init`. In the latter case, a buffer is not
76 Alternatively, a stack can be defined and initialized at compile time
86 Pushing to a Stack
89 A data item is added to a stack by calling :c:func:`k_stack_push`.
91 The following code builds on the example above, and shows how a thread
92 can create a pool of data structures by saving their memory addresses
93 in a stack.
104 /* save address of each data structure in a stack */
109 Popping from a Stack
112 A data item is taken from a stack by calling :c:func:`k_stack_pop`.
114 The following code builds on the example above, and shows how a thread
129 Use a stack to store and retrieve integer data values in a "last in,