|
|
|
|
|
by sethammons
314 days ago
|
|
almost always, the recommendation is to not embed your mutex; give it a name. foo.mu.Lock() This way you don't expose your primitives, preventing poor usage from causing a deadlock. Generally you don't want the user of your struct to have to know when or when to not lock. |
|
But it's good advice when it works.