And you have to make sure that a ctx is not incorrectly shared… ugh. 

> On Feb 7, 2023, at 7:41 AM, Robert Engels <reng...@ix.netcom.com> wrote:
> 
> I know this topic comes up a bit and I’ve done a bit more research. 
> 
> Is a contributing reason that Go does not have re-entrant locks is that Go 
> does not have any way to get Go routine identity? It seems you cannot write a 
> reentrant lock - at least not with the typical syntax - without specialized 
> runtime support. 
> 
> The only public way I can think of is something like
> 
> somelock.Lock(ctx)
> 
> But then you need to make every method accept a context.Context instance.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/D4211DBD-3147-41E0-B679-C0569DC2029B%40ix.netcom.com.

Reply via email to