Hardware Reference
In-Depth Information
Semaphore Control Block
counter
semaphore queue
pointer to the next SCB
Figure 10.10
Semaphore Control Block.
Each SCB is an element of the vsem[MAXSEM] array, whose size is equal to the maxi-
mum number of semaphores handled by the kernel. According to this approach, tasks,
semaphores, and queues can be accessed by an integer number that represents the
index of the corresponding control block. For the sake of clarity, however, tasks,
semaphores and queues are defined as three different types.
typedef int
queue;
/* head index
*/
typedef int
sem;
/* semaphore index
*/
typedef int
proc;
/* process index
*/
typedef int
cab;
/* cab buffer index
*/
typedef char*
pointer;
/* memory pointer
*/
Search WWH ::




Custom Search