|
|
|
|
|
by reactordev
325 days ago
|
|
if id == 1 {
counter++;
}
Found your problem. /sIn all honesty, if you “do work” using channels then all your goroutines are “thread safe” as the channel keeps things in order. Also, mutex is working as intended. As you see in your post, -race sees this, it’s good. Now have one goroutine read from a chan, get rid of the mutex, all other goroutines write to the chan, perfection. |
|