Skip to content

Commit

Permalink
Address feedback on zlib change (#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Corry authored Aug 4, 2023
1 parent 5f29288 commit 290f520
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/zlib.toit
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ abstract class Coder_:
signal_ /monitor.Signal := monitor.Signal
state_/int := STATE_READY_TO_READ_ | STATE_READY_TO_WRITE_

static STATE_READY_TO_READ_ ::= 1
static STATE_READY_TO_WRITE_ ::= 2
static STATE_READY_TO_READ_ ::= 1 << 0
static STATE_READY_TO_WRITE_ ::= 1 << 1

constructor .zlib_:
reader = ZlibReader.private_
Expand All @@ -259,12 +259,12 @@ abstract class Coder_:
return result

close_read_ -> none:
state_ |= STATE_READY_TO_WRITE_
signal_.raise
if not closed_read_:
closed_read_ = true
if closed_write_:
uninit_
state_ |= STATE_READY_TO_WRITE_
signal_.raise

write --wait/bool=true data -> int:
if closed_read_: throw "READER_CLOSED"
Expand Down

0 comments on commit 290f520

Please sign in to comment.