Skip to content

Commit

Permalink
fixes #206
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Oct 22, 2024
1 parent 2eb10b3 commit cf6f0e5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions include/boost/cobalt/channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ struct channel
this->unlink();
}

void interrupt_await()
{
this->cancelled = true;
if (awaited_from)
awaited_from.release().resume();
}

struct cancel_impl;
bool await_ready() { return !chn->buffer_.empty(); }
template<typename Promise>
Expand Down Expand Up @@ -118,6 +125,13 @@ struct channel
this->unlink();
}

void interrupt_await()
{
this->cancelled = true;
if (awaited_from)
awaited_from.release().resume();
}

struct cancel_impl;

bool await_ready() { return !chn->buffer_.full(); }
Expand Down Expand Up @@ -234,6 +248,13 @@ struct channel<void>
this->unlink();
}

void interrupt_await()
{
this->cancelled = true;
if (awaited_from)
awaited_from.release().resume();
}

struct cancel_impl;
bool await_ready() { return (chn->n_ > 0); }
template<typename Promise>
Expand Down Expand Up @@ -261,6 +282,13 @@ struct channel<void>
this->unlink();
}

void interrupt_await()
{
this->cancelled = true;
if (awaited_from)
awaited_from.release().resume();
}

struct cancel_impl;
bool await_ready()
{
Expand Down

0 comments on commit cf6f0e5

Please sign in to comment.