Skip to content

Commit

Permalink
fix: weaken timer wakers to ERefs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Mar 2, 2021
1 parent 727706e commit dda396f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/SwingSet/src/vats/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* schedule a single wake() call, create a repeater that will allow scheduling
* of events at regular intervals, or remove scheduled calls.
* @property {() => Timestamp} getCurrentTimestamp Retrieve the latest timestamp
* @property {(baseTime: Timestamp, waker: TimerWaker) => Timestamp} setWakeup Return
* @property {(baseTime: Timestamp, waker: ERef<TimerWaker>) => Timestamp} setWakeup Return
* value is the time at which the call is scheduled to take place
* @property {(waker: TimerWaker) => Array<Timestamp>} removeWakeup Remove the waker
* @property {(waker: ERef<TimerWaker>) => Array<Timestamp>} removeWakeup Remove the waker
* from all its scheduled wakeups, whether produced by `timer.setWakeup(h)` or
* `repeater.schedule(h)`.
* @property {(delay: RelativeTime, interval: RelativeTime) => TimerRepeater} createRepeater
Expand Down Expand Up @@ -40,7 +40,7 @@

/**
* @typedef {Object} TimerRepeater
* @property {(waker: TimerWaker) => Timestamp} schedule Returns the time scheduled for
* @property {(waker: ERef<TimerWaker>) => Timestamp} schedule Returns the time scheduled for
* the first call to `E(waker).wake()`. The waker will continue to be scheduled
* every interval until the repeater is disabled.
* @property {() => void} disable Disable this repeater, so `schedule(w)` can't
Expand Down
4 changes: 2 additions & 2 deletions packages/zoe/tools/manualTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { makeNotifierKit } from '@agoric/notifier';
export default function buildManualTimer(log, startValue = 0n) {
let ticks = Nat(startValue);

/** @type {Store<Timestamp, Array<TimerWaker>>} */
/** @type {Store<Timestamp, Array<ERef<TimerWaker>>>} */
const schedule = makeStore('Timestamp');

const makeRepeater = (delaySecs, interval, timer) => {
assert.typeof(delaySecs, 'bigint');
assert.typeof(interval, 'bigint');
/** @type {Array<TimerWaker> | null} */
/** @type {Array<ERef<TimerWaker>> | null} */
let wakers = [];
let nextWakeup;

Expand Down

0 comments on commit dda396f

Please sign in to comment.