To work around this omission, I use the POSIX condition variable emulations synchronization primitives, which are outlined in the series of articles.
为解决此缺憾,我使用POSIX条件变量模拟同步原语,并在一系列文章中对此进行了概述。
While the target variable is guaranteed to be only assigned once, the delegate may be called by multiple concurrent threads unless a synchronization object is passed in.
这保证了目标变量只会设置一次。不过,如果没有使用同步对象的话,委托可能会被几个并发线程调用多次。
When more than one thread accesses a mutable variable, all threads must use synchronization, or else some very bad things can happen.
在不只一个线程访问一个互斥的变量时,所有线程都必须使用同步,否则就可能会发生一些非常糟糕的事情。
应用推荐