MCPcopy
hub / github.com/google/gvisor / Queue

Struct Queue

pkg/sentry/kernel/msgqueue/msgqueue.go:65–115  ·  view source on GitHub ↗

Queue represents a SysV message queue, described by sysvipc(7). +stateify savable

Source from the content-addressed store, hash-verified

63//
64// +stateify savable
65type Queue struct {
66 // registry is the registry owning this queue. Immutable.
67 registry *Registry
68
69 // mu protects all the fields below.
70 mu sync.Mutex `state:"nosave"`
71
72 // dead is set to true when a queue is removed from the registry and should
73 // not be used. Operations on the queue should check dead, and return
74 // EIDRM if set to true.
75 dead bool
76
77 // obj defines basic fields that should be included in all SysV IPC objects.
78 obj *ipc.Object
79
80 // senders holds a queue of blocked message senders. Senders are notified
81 // when enough space is available in the queue to insert their message.
82 senders waiter.Queue
83
84 // receivers holds a queue of blocked receivers. Receivers are notified
85 // when a new message is inserted into the queue and can be received.
86 receivers waiter.Queue
87
88 // messages is a list of sent messages.
89 messages msgList
90
91 // sendTime is the last time a msgsnd was performed.
92 sendTime ktime.Time
93
94 // receiveTime is the last time a msgrcv was performed.
95 receiveTime ktime.Time
96
97 // changeTime is the last time the queue was modified using msgctl.
98 changeTime ktime.Time
99
100 // byteCount is the current number of message bytes in the queue.
101 byteCount uint64
102
103 // messageCount is the current number of messages in the queue.
104 messageCount uint64
105
106 // maxBytes is the maximum allowed number of bytes in the queue, and is also
107 // used as a limit for the number of total possible messages.
108 maxBytes uint64
109
110 // sendPID is the PID of the process that performed the last msgsnd.
111 sendPID int32
112
113 // receivePID is the PID of the process that performed the last msgrcv.
114 receivePID int32
115}
116
117// Message represents a message exchanged through a Queue via msgsnd(2) and
118// msgrcv(2).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected