文章目录 当先调用park时:如果_counter=0,这时候该线程阻塞,进入_cond阻塞,之后Unpark设置_counter为1后停止阻塞 当先调用Unpark时:此时先将_counter设置为1,当后面出现park时一判断_counter为1,则不阻塞该线程,将_counter设置为0.