I looked at two libs docs and found it's same between those two.
What's the different between those?
Nim doesn't expose that to the end user. The official docs for Nim locks say that whether a lock is re-entrant or not is "unspecified", so where are you seeing this?
@See: https://nim-lang.org/docs/locks.html#Lock
A re-entrant lock is a lock that can be re-acquired by the same thread without causing a deadlock. https://en.wikipedia.org/wiki/Reentrant_mutex
At the moment, at least on native linux, it is a re-entrant lock, and all locks on Windows are re-entrant, but for Javascript or other platforms I have no idea... This is probably why it is unspecified in the manual, it is very platform dependent.
@see: https://github.com/nim-lang/Nim/blob/master/lib/system/syslocks.nim#L187
Edit: I didn't realize that Nim keeps re-entrant locks in a different module here: https://nim-lang.org/docs/rlocks.html
Everything else I said is still valid though!
Thank you.
I've read several articles about re-entrant lock, but those articles almost all discussed in Java as examples.
When I thought whether those were applicable in Nim too and I found two different modules of lock and with almost same APIs.
No problem. Glad I could help :-)
Yeah, re-entrant locks are common among most system level languages.