Skip to content

add stop token bits, receiver queries, a manual event loop, and a single-thread context#185

Merged
ericniebler merged 3 commits intomainfrom
stop-token-and-receiver-queries
Sep 1, 2021
Merged

add stop token bits, receiver queries, a manual event loop, and a single-thread context#185
ericniebler merged 3 commits intomainfrom
stop-token-and-receiver-queries

Conversation

@ericniebler
Copy link
Collaborator

No description provided.

@ericniebler ericniebler force-pushed the stop-token-and-receiver-queries branch from 1d75b77 to 8a995a5 Compare August 31, 2021 05:45
@ericniebler ericniebler requested a review from LeeHowes August 31, 2021 05:45
@ericniebler ericniebler force-pushed the stop-token-and-receiver-queries branch from 8a995a5 to c2b80d9 Compare August 31, 2021 05:58
namespace detail {
struct task_base {
void execute() noexcept {
this->execute_(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execute_ does not match the spelling _execute on line 41

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not referring to that function. It's referring to the task_base::execute_ data member on line 36.

}
}

inline void manual_event_loop::stop() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably no change from libunifex, but stop doesn't appear to do the right thing. I don't see the code in run that loops through all the tasks invoking set_done()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't. It only stops when the queue has drained.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit confusing because stop means cancel elsewhere and it means exit run when empty here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I should call it request_stop()?

@ericniebler ericniebler merged commit 22a7098 into main Sep 1, 2021
@ericniebler ericniebler deleted the stop-token-and-receiver-queries branch September 1, 2021 19:17
github-actions bot pushed a commit that referenced this pull request Sep 1, 2021
…op, and a single-thread context (#185)

add stop token bits, receiver queries, a manual event loop, and a single-thread context 22a7098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants