清单3介绍了设置互斥的静态方法。
ABD和MDD并不是互斥的。
设置互斥的另一种方式是使用互斥属性对象。
Another way of setting the mutex kind is by using a mutex attribute object.
使用下面的函数解开对互斥的锁定(见清单5)。
这里是获得进程间互斥的另一Win32示例代码。
Here is another Win32 sample code to acquire mutex between processes.
这个函数会获得一个指向它正在尝试锁定的互斥的指针。
This function gets a pointer to the mutex it is trying to lock.
SashForm必须定义成以下两种互斥的样式之一。
SashForms must be defined as one of two mutually exclusive styles.
软ap和adhoc网络在同一块物理网卡上是互斥的。
SoftAP and AD hoc networking are mutually exclusive on the same physical adapter.
相应的获得进程内互斥的Linux示例代码(见清单15)。
An equivalent Linux sample code to acquire mutex within a process (see Listing 15).
这两个邮件客户机并不是互斥的;可以自行选择最适合您需求的邮件客户机。
These two mail clients are not mutually exclusive; you can choose the mail client that best fits your access needs at your current location.
这里是获得进程内互斥的Win32示例代码(见listing14)。
Here is the Win32 sample code to acquire a mutex within a process (see Listing 14).
当启用该级别时,可以使用来自不同级别的不同规则,这些规则本身是互斥的。
It allows you to use different rules from different levels, the rules themselves being mutually exclusive of one another.
这些文件可以全部存在,也可以存在一个,或者都不存在,这取决于应用程序将这些文件视为互斥的还是递增的。
None, one, or all of these files can exist, and it's up to the application to treat the files as mutually exclusive or incremental.
然而与一些人所认为的相反,这些不同的面向服务体系结构(Service - Oriented Architecture,SOA)设计模式不是互斥的。
Contrary to what some might believe; however, these distinct Service-Oriented Architecture (SOA) design patterns are not mutually exclusive.
这对于等待同一互斥锁的其他线程有不利影响,因为等待时间现在会更长。
For other threads waiting on the same mutex, this has a negative effect, because the wait time is now even longer.
互斥有名称,并且,一个给定名称的互斥在同一机器上同一时刻只能存在一个。
Mutexes have names, and only one mutex of a given name can exist on a machine at a time.
这个方法允许您设置互斥信号量对象的相关属性。
确定特定体系结构的变化,比如互斥锁定(mutex locking)。
Identifying architecture-specific changes such as mutex locking.
如果进行调用的线程并不拥有那个互斥对象,则这个调用可能会失败。
This call might fail if the calling thread does not own the mutex object.
如果调用线程并不拥有这个互斥信号量,那么这个函数的执行将会失败。
If the calling thread has no ownership of this mutex, this function fails.
始终应该尽快对已加锁的互斥对象进行解锁(以提高性能)。
You should always unlock a mutex that you've locked as soon as safely possible (to increase performance).
代码可以反复对互斥对象锁定和解锁,以检查值的任何变化。
Your code could repeatedly lock and unlock the mutex, checking for any changes to the value.
它还会检查互斥在那个时刻是不是解除锁定的(见清单9)。
It also checks whether the mutex is unlocked at that time (see Listing 9).
所以,让我们更进一步,在产生随机数的地方加一个互斥量。
So, let's say we go ahead and add a mutex that surrounds the random number generator.
更好的做法是定义另一个方法,它接收一系列整数,只获取并释放互斥锁一次。
A far better approach would be to define another method that accepts a list of integers and acquire and release the mutex only once.
我们还引用了一系列互斥示例代码来帮助您进行从Win32到Linux的迁移行动。
We also referenced lists of mutex sample codes to help you when you undertake the migration activity involving Win32 to Linux.
假设有一个具有互斥分支的循环流;每个分支都有一些应用于该分支中所有活动的前置条件和不变量。
Consider a cyclic flow that has mutually exclusive branches; each branch has preconditions and invariants that apply to all activities in the branch.
最后,当一个线程从调用pthread_cond_wait而被唤醒时,要做的第一件事就是重新锁定它在最初调用时解锁的那个互斥量。
Finally, the first thing any thread tries to do when waking up from pthread_cond_wait is re-lock the mutex it unlocked when initially called.
为了帮助实现互斥锁分配和锁定时间的最小化,JVM管理一个全局锁缓存和一个单线程锁缓存,其中每个缓存包含了未分配的 pthread_mutex。
To help minimize mutex allocation and locking time, the JVM manages a global lock cache and a per-thread lock cache where each cache contains unallocated pthread_mutexes.
为了帮助实现互斥锁分配和锁定时间的最小化,JVM管理一个全局锁缓存和一个单线程锁缓存,其中每个缓存包含了未分配的 pthread_mutex。
To help minimize mutex allocation and locking time, the JVM manages a global lock cache and a per-thread lock cache where each cache contains unallocated pthread_mutexes.
应用推荐