Use atomic Swap instead of Load+close to prevent concurrent Stop() calls from both passing the check and closing the channel twice.
Use atomic Swap instead of Load+close to prevent concurrent Stop() calls from both passing the check and closing the channel twice.