Skip to content

Commit

Permalink
Provide implementation hints for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Jul 14, 2024
1 parent 45480cf commit 00bb910
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions twin/screen-setup-windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ type interruptableReaderImpl struct {
shutdownRequested atomic.Bool
}

// NOTE: To work properly, this Read() should return immediately after somebody
// calls Interrupt(), *without first reading any bytes from the base reader*.
//
// This implementation doesn't do that. If you want to fix this, the not-Windows
// implementation in screen-setup.go may or may not work as inspiration.
func (r *interruptableReaderImpl) Read(p []byte) (n int, err error) {
if r.shutdownRequested.Load() {
err = io.EOF
Expand Down

0 comments on commit 00bb910

Please sign in to comment.