[park and unpark]

[park and unpark]

notes

insert image description here
This mutex mutex, I don't understand its purpose for the time being, because it just blocks the current thread. What I understand is how this mutual exclusion situation occurs? Is it afraid that there are multiple threads to execute its internal unpark method, and there will be thread synchronization problems? may be. _cond represents an internal blocking queue, and _counter represents a flag bit. These two are easy to understand and don’t say anything.
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_46356409/article/details/126243024