Skip to content
  • Lars Kanis's avatar
    9c058270
    Fix example fiber scheduler reg. writable events · 9c058270
    Lars Kanis authored
    There were two issues:
    
    1. When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty.
       Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.
    
    2. When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these
       two events arrive, the Fiber and IO object need to be removed from the other `@readable` or `@writable` list.
    9c058270
    Fix example fiber scheduler reg. writable events
    Lars Kanis authored
    There were two issues:
    
    1. When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty.
       Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.
    
    2. When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these
       two events arrive, the Fiber and IO object need to be removed from the other `@readable` or `@writable` list.
Loading