并发断言 及时断言区别
Assertions are very helpful to find problems or bugs. But, sometimes there's a problem
断言对于发现问题或错误非常有帮助。 但是,有时候会有问题
using them, for example within a loop or a very often called function, because if such an
使用它们,例如在循环中或经常调用的函数中使用,因为如果
assertion fails it may happen that tons of assertion-dialogs pop up (at least in VC++
断言失败,可能会弹出大量断言对话框(至少在VC ++中)
with 'ASSERT'-macro that's quite a mess).
与“ ASSERT”宏非常混乱)。
The following macro can be used easily just the same way as VC++'s 'ASSERT'-macro or
可以很容易地使用以下宏,就像VC ++的“ ASSERT”宏或
CRT's 'assert'. To make its usage thread-safe first I introduce a simple class which does
CRT的“断言”。 为了使它的使用成为线程安全的,我首先介绍一个简单的类
synchronization using a mute