summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/pending_signals_state.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2018-08-23 16:31:25 -0700
committerShentubot <shentubot@google.com>2018-08-23 16:32:36 -0700
commit64403265a04aa0c8be3ebb652a09f6e2d7a84ca7 (patch)
tree8191f06fca712de5588cd418a70707e9df0f2c25 /pkg/sentry/kernel/pending_signals_state.go
parente855e9cebc45f5fd7a9583f476c8965fc395a15e (diff)
Implement POSIX per-process interval timers.
PiperOrigin-RevId: 210021612 Change-Id: If7c161e6fd08cf17942bfb6bc5a8d2c4e271c61e
Diffstat (limited to 'pkg/sentry/kernel/pending_signals_state.go')
-rw-r--r--pkg/sentry/kernel/pending_signals_state.go21
1 files changed, 15 insertions, 6 deletions
diff --git a/pkg/sentry/kernel/pending_signals_state.go b/pkg/sentry/kernel/pending_signals_state.go
index af61f6e8e..6d90ed033 100644
--- a/pkg/sentry/kernel/pending_signals_state.go
+++ b/pkg/sentry/kernel/pending_signals_state.go
@@ -18,20 +18,29 @@ import (
"gvisor.googlesource.com/gvisor/pkg/sentry/arch"
)
+// +stateify savable
+type savedPendingSignal struct {
+ si *arch.SignalInfo
+ timer *IntervalTimer
+}
+
// saveSignals is invoked by stateify.
-func (p *pendingSignals) saveSignals() []*arch.SignalInfo {
- var pending []*arch.SignalInfo
+func (p *pendingSignals) saveSignals() []savedPendingSignal {
+ var pending []savedPendingSignal
for _, q := range p.signals {
for ps := q.pendingSignalList.Front(); ps != nil; ps = ps.Next() {
- pending = append(pending, ps.SignalInfo)
+ pending = append(pending, savedPendingSignal{
+ si: ps.SignalInfo,
+ timer: ps.timer,
+ })
}
}
return pending
}
// loadSignals is invoked by stateify.
-func (p *pendingSignals) loadSignals(pending []*arch.SignalInfo) {
- for _, si := range pending {
- p.enqueue(si)
+func (p *pendingSignals) loadSignals(pending []savedPendingSignal) {
+ for _, sps := range pending {
+ p.enqueue(sps.si, sps.timer)
}
}