Home > Software design >  How to find the number of threads waiting for mutex lock in Sync.Mutex?
How to find the number of threads waiting for mutex lock in Sync.Mutex?

Time:08-11

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()?

CodePudding user response:

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.)

  • Related