make token.Done idempotent

This commit is contained in:
vyzo 2023-03-23 17:38:36 +02:00 committed by Maciej Witowski
parent 9f2675422a
commit c5f878c941

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 {