Skip to content
Myr

fix: lock renderer during stop/kill

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Muehlhaeuser · committed by Christian Muehlhaeuser · parent e119cd8 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:standard_renderer.go+8 added
74 unmodified lines
75}7677// stop permanently halts the renderer, rendering the final frame.78func (r *standardRenderer) stop() {79 // flush locks the mutex80 r.flush()8182 r.mtx.Lock()83 defer r.mtx.Unlock()8485 r.out.ClearLine()86 r.once.Do(func() {87 close(r.done)88 })
6 unmodified lines
95}9697// kill halts the renderer. The final frame will not be rendered.98func (r *standardRenderer) kill() {99 r.mtx.Lock()100 defer r.mtx.Unlock()101102 r.out.ClearLine()103 r.once.Do(func() {104 close(r.done)105 })
510 unmodified lines