diff --git a/lib/zlib.toit b/lib/zlib.toit index 433179665..7aa457ce0 100644 --- a/lib/zlib.toit +++ b/lib/zlib.toit @@ -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_ @@ -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"