-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close cannot close all pops... #23
Comments
Hey. Could you add three backticks ` before and after your example and properly format it so it becomes redable? Also, what exactly is the code supposed to show? |
hey, Reply so quickly use this code the thread is always in the join ,if ~channel() called will assert error
This is my revised code, It seems to work.
|
I added a branch with a regression test and I confirm that I encounter a similar issue. But for me, the assertions don't fail; instead, I run into a deadlock. Your change also doesn't fix that. I'll see what I can do but so far I don't really have an idea. If you have more information or ideas, that might help. |
copper::chan channel;
void ch1() {
printf("ch1 start\n");
for (const auto& item : channel) {
printf("%s\n", item.c_str());
}
printf("ch1 end\n");
}
void ch2(copper::chan& channel) {
printf("ch2 start\n");
}
void aa() {
for (size_t i = 0; i < 5; i++)
{
new std::thread(& {
ch1();
});
}
The text was updated successfully, but these errors were encountered: