whether this situation can only be judged by sync.Map and Channel
.whether this situation can only be judged by sync.Map and Channel
.first, you need to close one of them. If the outside of your program can find the co-program you need to close, you need to inject some identification or something, such as using map to store these identities. Each co-program injects a channel, and then uses select to run inside the co-program to determine whether the channel is close. If close is off, exit the co-program ~
.