Table 1910 The fields in the semqueue data structure

Type

Field

Description

struct sem queue *

next

Pointer to next queue element

struct sem queue **

prev

Pointer to previous queue element

struct task_struct *

sleeper

Pointer to the sleeping process that requested the semaphore operation

struct sem undo *

undo

Pointer to sem undo structure

int

pid

Process identifier

int

status

Completion status of operation

struct sem array *

sma

Pointer to IPC semaphore descriptor

int

id

Slot index of the IPC semaphore resource

struct sembuf *

sops

Pointer to array of pending operations

int

nsops

Number of pending operations

int

alter

Flag indicating that the operation sets the semaphore value

Figure 19-1 illustrates an IPC semaphore that has three pending requests. Two of them refer to undoable operations, so the undo field of the sem_queue data structure points to the corresponding sem_undo structure; the third pending request has a null undo field since the corresponding operation is not undoable.

Was this article helpful?

0 0

Post a comment