Skip to content

close cannot close all pops... #23

Description

@xbyl1234

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");

channel.push("2");

printf("ch2 end\n");

}

void aa() {
for (size_t i = 0; i < 5; i++)
{
new std::thread(& {
ch1();
});

}
//sleep(1000 * 2);
std::thread* my_thread2 = new std::thread([&]() {
	ch2(channel);
	channel.close();
	}); 

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions