Skip to content

Commit 0750a07

Browse files
committed
Document coroutine_sleep_read() and coroutine_sleep_write() calls
1 parent 9e48886 commit 0750a07

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coroutine.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ size_t coroutine_id(void);
3434
// to wait until all the "child" coroutines have died.
3535
size_t coroutine_alive(void);
3636

37+
// Put the current coroutine to sleep until the non-blocking socket `fd` has avaliable data to read.
38+
// Trying to read from fd after coroutine_sleep_read() should not cause EAGAIN.
3739
void coroutine_sleep_read(int fd);
40+
41+
// Put the current coroutine to sleep until the non-blocking socket `fd` is ready to accept data to write.
42+
// Trying to write to fd after coroutine_sleep_write() should not cause EAGAIN.
3843
void coroutine_sleep_write(int fd);
3944

4045
#ifdef __cplusplus

0 commit comments

Comments
 (0)