make token.Done idempotent

This commit is contained in:
vyzo 2023-03-23 17:38:36 +02:00
parent 2bb89d9c30
commit 2a0660447a

View File

@ -73,9 +73,11 @@ func (e *vmExecutor) Done() {
e.lk.Lock()
defer e.lk.Unlock()
e.token.Done()
e.token = nil
e.done = true
if !e.done {
e.token.Done()
e.token = nil
e.done = true
}
}
type executionToken struct {