<discocaml>
<darrenldl> is there a mutex that only blocks on lock if the lock was previously held by a different domain, but passes through if it's held by the same domain?
ocra8_ has quit [Quit: WeeChat 4.2.2]
<companion_cube>
I think that's called a reentrant lock
<companion_cube>
Not in the stdlib
<dh`>
reentrant or recursive
<dh`>
it is something you don't want unless you need it to deal with legacy messes
<discocaml>
<darrenldl> > Not in the stdlib
<discocaml>
<darrenldl> ah oh well
<discocaml>
<darrenldl> > something you don't want
<discocaml>
<darrenldl> fair enough, i'm probably opening can of worms i don't know enough about: i was trying to add thread safety to lwd as a wrapper
<companion_cube>
sounds hard
<companion_cube>
the dirty flag could be made boolean perhaps
<companion_cube>
atomic*
<discocaml>
<darrenldl> the other idea is just to delay all Lwd.set (by putting them into a mutex queue) until next loop, but this changes what Lwd.set means slightly maybe
<companion_cube>
sounds really hard tbh
<companion_cube>
but use saturn to get a lock free queue
<companion_cube>
(a mutex protected queue doesn't require a reentrant mutex btw)
<discocaml>
<darrenldl> yeah no i wanted a reentrant queue to avoid deadlocking when calling Lwd.set inside Lwd.map, but doesn't really make sense after thinking about it a bit more