I am using this in a go subroutine
a.Lock()
...
enter code here
...
a.Unlock()
Is there any api to know how many threads are waiting at a.Lock()?
Is there any api to know how many threads are waiting at a.Lock()?
No.
(And basically if you need to know that you should redesign your aglorithm.)