Skip to content

Commit

Permalink
Removed loop_select family and updated reference with warning due to …
Browse files Browse the repository at this point in the history
…unexpected locking of channels.
  • Loading branch information
atollk committed Apr 26, 2021
1 parent b2fba07 commit 7713f59
Show file tree
Hide file tree
Showing 6 changed files with 427 additions and 372 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ set_property(TARGET copper_tests PROPERTY CXX_STANDARD 20)

enable_testing()
add_test(copper_tests copper_tests)

add_executable(main main.cpp)
target_link_libraries(main PRIVATE copper Threads::Threads)
set_property(TARGET main PROPERTY CXX_STANDARD 20)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ void producer_2() {

void consumer() {
// Until both channel_1 and channel_2 are closed, get the next message from either and print it.
copper::loop_select(
while (copper::select(
channel_1 >> [](int x) { std::cout << "Message from producer 1: " << x << std::endl; },
channel_2 >> [](int x) { std::cout << "Message from producer 2: " << x << std::endl; }
);
));
}

int main() {
Expand Down
Loading

0 comments on commit 7713f59

Please sign in to comment.