Friday, September 30, 2022

[FIXED] How to find the number of threads waiting for mutex lock in Sync.Mutex?

Issue

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


Solution

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



Answered By - Volker
Answer Checked By - David Goodson (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.