Lines Matching full:a
6 A :dfn:`semaphore` is a kernel object that implements a traditional
19 A semaphore has the following key properties:
21 * A **count** that indicates the number of times the semaphore can be taken.
22 A count of zero indicates that the semaphore is unavailable.
24 * A **limit** that indicates the maximum value the semaphore's count
27 A semaphore must be initialized before it can be used. Its count must be set
28 to a non-negative value that is less than or equal to its limit.
30 A semaphore may be **given** by a thread or an ISR. Giving the semaphore
33 A semaphore may be **taken** by a thread. Taking the semaphore
35 When a semaphore is unavailable a thread may choose to wait for it to be given.
41 You may initialize a "full" semaphore (count equal to limit) to limit the number
43 initialize an empty semaphore (count equal to 0, with a limit greater than 0)
44 to create a gate through which no waiting thread may pass until the semaphore
48 The kernel does allow an ISR to take a semaphore, however the ISR must
54 Defining a Semaphore
57 A semaphore is defined using a variable of type :c:struct:`k_sem`.
60 The following code defines a semaphore, then configures it as a binary
69 Alternatively, a semaphore can be defined and initialized at compile time
78 Giving a Semaphore
81 A semaphore is given by calling :c:func:`k_sem_give`.
84 indicate that a unit of data is available for processing by a consumer thread.
96 Taking a Semaphore
99 A semaphore is taken by calling :c:func:`k_sem_take`.
103 A warning is issued if the semaphore is not obtained in time.
123 Use a semaphore to control access to a set of resources by multiple threads.
125 Use a semaphore to synchronize processing between a producing and consuming