Otherwise, if two threads tried to execute the increment simultaneously, an unlucky interleaving of operations would result in the counter being incremented only once, instead of twice.
否则,如果两个线程试图同时执行增加,操作的不幸交叉将导致计数器只被实现了一次,而不是被实现两次。
If not NULL, increment the line counter.
如果不是NULL,则增加行计数器。
Check each char read to see whether it is a form feed; if so, increment the page counter.
检查每个读取的字符是否为换页符;若是,则增加页计数器。
That's still a lot of code just to increment a counter with a lock held!
要递增一个加锁的计数器仍然需要编写很多代码!
In the case of the counter, the speculative step is the increment — it fetches and adds one to the old value in the hopes that the value will not change while the update is being computed.
在计数器的示例中,冒险的步骤是递增——它检索旧值并在旧值上加一,希望在计算更新期间值不会变化。
Perhaps in this case, we could use a timestamp or just increment a counter for each runner, such as runner_1, runner_2, etc.
可能在本例中,我们可以使用一个时间戳或仅为每个参赛者增加一个计数器,比如runner_1、runner_2等。
Of course, you can run loops backward instead of forward, or increment the loop counter by something other than 1, or even eliminate the loop counter completely as you do in a while statement.
当然,也可以反向而不是正向运行循环,或者使用1之外的循环计数器增量,甚至像while语句那样完全取消循环计数器。
This instance simply has to increment the counter variable and start a new event handler instance using an invoke activity.
该实例必须增加计数器变量,并使用调用活动启动新的事件处理程序实例。
There's a method to increment the counter and a method to clear it, and that's it!
有一个方法递增计数器,还有一个方法清除计数器,这就够了!
The statistics are being collected by a message-driven bean (MDB) that is constructed to listen to the topic and increment an internal counter when a message is received.
统计信息由消息驱动的 bean (MDB)收集,MDB被构建为在收到消息时侦听主题并增量内部计数器。
You could hardly imagine a more trivial task: increment a counter when you find a special element.
很难想象有比这更繁琐的工作:当您发现一个特殊元素时就将计数器加1。
Just change the function call to read increment( &$counter ).
只需将这个函数调用改为increment(&$counter )。
With your new Counter object defined, you call the increment method and then emit the Counter value using your getter method.
在定义了新的Counter对象之后,请调用increment方法,然后使用getter方法获得counter值。
Then you could traverse the string and, for each character, increment the corresponding counter, probably using a chained conditional.
然后你遍历整个字符串,每个字母的个数都累加到对应的计数器里面,可能会用到分支条件判断。
Then you could convert each character to a number (using the built-in function ord), use the number as an index into the list, and increment the appropriate counter.
然后你把每个字母转换成一个数字(用内置的ord函数),用这些数字作为这个列表的索引,然后累加相应的计数器。
Writes always increment the counter.
总写计数器增量。
The station will then increment the soft error counter for Abort Delimiter Transmitted, and send a soft error report within two seconds.
工作站将增加发送的异常终止分隔符软件错误统计,并且在2秒内发送软件错误报告。
At that point, the counter began to increment and the database was restored.
此时,计数器开始计数,数据库完成恢复。
Coin of Plutus - Increases the combo window that allows Dante to acquire Style Points and increment the Hit Counter.
普鲁·图斯的钱币:加大连击的间隙时间,允许玩家更容易的连击。
Coin of Plutus - Increases the combo window that allows Dante to acquire Style Points and increment the Hit Counter.
普鲁·图斯的钱币:加大连击的间隙时间,允许玩家更容易的连击。
应用推荐