但是对于某个变量的条件产生的模糊性是应该限制的。
But ambiguity need not be restricted to conditions of one variable.
采用这种方法,可以模拟各种条件、事件发生次序和变量。
With this approach, you could simulate the various conditions, sequence, and variables.
如果某条语句发出一个存在处理程序的条件,那么SQLSTATE和SQLCODE变量的值就可以在开始执行处理程序时获得。
If a statement raises a condition for which a handler exists, the values of the SQLSTATE and SQLCODE variables are available at the beginning of the handler execution.
接下来,读线程需要确保(这是第二个检查)它等待条件变量的时间不超过指定的超时时间。
Next, the reader thread needs to ensure (and this is the second check you perform) that it does not wait on the condition variable any more than the specified timeout period.
另外,您也可以不使用变量,如清单6中所示,因为条件很简单。
Alternatively, you can drop the variable, as in Listing 6, because the condition is so simple.
线程模块提供了许多同步原语,包括信号量、条件变量、事件和锁。
The threading module does provide many synchronization primatives, including semaphores, condition variables, events, and locks.
当队列是空的时候,读线程现在并不抛出异常,而是在条件变量上阻塞自身。
Instead of throwing an exception when the queue is empty, the reader thread now blocks itself on the condition variable.
为解决此缺憾,我使用POSIX条件变量模拟同步原语,并在一系列文章中对此进行了概述。
To work around this omission, I use the POSIX condition variable emulations synchronization primitives, which are outlined in the series of articles.
它不但要求仔细分析在什么条件可以对变量进行读写,而且要求仔细分析其它类能如何使用某个类。
It requires a careful analysis of not only the conditions under which variables will be read or written, but also of how the class might be used by other classes.
当然,您还可以创建一个全局的脚本,并使用条件和环境变量HOSTNAME以选择合适的设置。
Of course, you can also create a global script and use conditionals and the environment variable HOSTNAME to choose the appropriate settings.
毫无疑问,最常见的调试步骤是设置断点,这样可以检查条件语句或循环内的变量和值。
Undoubtedly, the most common debugging procedure is to set breakpoints that will allow the inspection of variables and the values inside conditional statements or loops.
使用单等于号来向变量赋值,而不是像在前一个条件中那样使用双等于号 (==) 来比较值。
Use the single equal sign to assign a value to a variable, unlike the double equal sign (==), as in the previous condition, which compare the values.
您可以方便地创建变量、循环,使用条件和创建函数。
You won't have any trouble creating variables, looping, using conditionals, and creating functions.
对于清单13和清单14,要注意的第一点是,这个阻塞队列有两个条件变量而不是一个。
The first thing of note in Listing 13 and Listing 14 is that there are two condition variables instead of the one that the blocking queue had.
条件变量让开发者能够实现一个条件,在这个条件下线程执行然后被阻塞。
A condition variable enables developers to implement a condition in which a thread executes and then blocked.
然后检验选择项组合碎片的约束条件,确认余额大于金额变量。
Then the option combination fragment's guard condition is checked to verify the balance is greater then the amount variable.
每个销售条目的产品ID (PID)被传递给PID变量,该变量是在产品提要的过滤条件中创建的。
The product ID (PID) for each sales entry is passed to the PID variable that was created in the filter condition of the product feed.
条件中指定的变量必须在设置了断点的行中,否则表达式就没有什么意义!
The variables specified in the condition must be in scope at whatever line you set the breakpoint on, otherwise the expression wouldn't make sense!
因此,最后两个读线程都等待条件变量,互斥锁没有被锁住。
Therefore, at the end of it all, you now have two reader threads, both waiting on the condition variable, and the mutex is unlocked.
对象不变量则将特定条件运用于对象的状态上,确保其不会拥有非法的值。
Object invariants are used to enforce certain conditions on objects to make sure they don't obtain illegal values.
这个操作要消耗一定的时间,实际上,这个时间太长了,可能在进行这项操作的同时,线程所等待的条件变量的值在这期间已经改变了。
This may take some time. In fact, it may take so much time that the condition you were waiting for is no longer the case.
它还允许您原子地(atomically)解除互斥的锁定,并等待条件变量,而不会有干涉其他线程的可能。
It also allows you to unlock the mutex and wait on the condition variable atomically, without the possible intervention of another thread.
函数pthread_cond_wait主要就是用于阻塞线程的,它有两个参数;第一个是一个指向条件变量的指针,第二个是一个锁定了的互斥量。
The function primarily used for this is pthread_cond_wait . It takes two arguments; the first is a pointer to a condition variable, and the second is a locked mutex.
第一个条件的限制使volatile变量不能用作线程安全计数器。
The first condition disqualifies volatile variables from being used as thread-safe counters.
push方法不依赖于任何条件变量,所以没有额外的等待。
Now, the push method doesn't depend on any condition variables, so no extra waiting there.
而且,条件可能随以下变量发生改变。
Furthermore, the conditions may be changed as according to these variables.
ClosureStylesheets让我们可以使用@if、@elseif和@else,从而基于某些变量的值来创建条件语句的分支。
Closure Stylesheets allows the use of @if, @elseif and @else in creating conditional branches based on the value of some variables.
这些例子演示scheme的一些关键特性,此外还演示了变量、条件和循环。
These examples illustrate variables, conditionals, and loops in addition to some of the key features of Scheme.
如果队列满了,写线程等待_ wcond条件变量;读线程在从队列中取出数据之后需要通知所有线程。
If the queue is full, the writer thread waits on the _wcond condition variable; the reader thread will need a notification to all threads after consuming data from the queue.
如果队列满了,写线程等待_ wcond条件变量;读线程在从队列中取出数据之后需要通知所有线程。
If the queue is full, the writer thread waits on the _wcond condition variable; the reader thread will need a notification to all threads after consuming data from the queue.
应用推荐