作为C++的初学者,面临的一个很大的问题,就是很多的概念并不是可以通过名称直观的预知它要完成的细节,比如这里的condition_variable的wait_for。C++的设计意图好像是,我告诉你这样用,你只要这样做就行,又简单还实用!而且需要记住的规则量又大的惊人。最后看起来,更像是给人工只能开发的开发语言,而不象是给人这种具有因果逻辑的生物而设计的。所以这种设计其实更不容易使用,因为每次使用,使用者脑子里都需要转换一下他两个之间的关系!
https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for
wait_for causes the current thread to block until the condition variable is notified, the given duration has been elapsed, or a spurious wakeup occurs. pred can be optionally provided to detect spurious