With locking, if one thread attempts to acquire a lock that is already held by another thread, the thread will block until the lock becomes available.
使用锁定,如果一个线程试图获取其他线程已经具有的锁定,那么该线程将被阻塞,直到该锁定可用。
And depending on what other optimizations are enabled by the larger basic block, the duration for which the lock is held may not even be lengthened under coarsening.
而且根据更大的基本块支持其他何种优化,在粗化的情况下,持有锁的时间甚至可能不会延长。
This synchronized code block acquires the lock associated with the customer class object before it executes.
同步的代码块在执行之前需要与客户类对象相关的锁。
Synchronized methods and blocks allow a thread to lock an object on entry and unlock the object on exit (to the method or block).
同步的方法和代码块允许线程在入口处锁定对象并在出口处解锁(针对方法或代码块)。
When two threads contend for a lock, one of them will get the lock and the other will have to block until the lock is available.
当两个线程竞争同一个锁时,其中一个会得到锁,另一个不得不阻塞,直到锁可用。
This is weaker than a pessimistic session lock -- the convention adhered to by the participants is to warn, not to block.
它较悲观会话锁更弱一些,相关方约定发出警告,而不是阻止。
If multiple threads attempt to lock a semaphore after the initial call above, they block and their requests are queued until the pthread_mutex_unlock call is performed.
如果多个线程在完成上面的初始调用后尝试锁定信号量,则这些线程会被阻塞,它们的请求进入队列,直到执行pthread _ mutex_unlock调用。
While no one would ever directly use the idiom in Listing 1, this code is very similar to the case where the lock associated with a synchronized block can be proven to be a thread-local variable.
虽然没有人会直接使用清单1中的形式,但是与这个代码非常类似的情况是:可以证实与synchronized块关联的锁是一个线程本地变量。
It is easy to forget to use a finally block to release the lock, to the great detriment of your program.
您很容易忘记用finally块释放锁,这对程序非常有害。
When multiple threads ask for the same lock at the same time, one wins and acquires the lock, and the others block.
在多个线程同时请求同一个锁时,会有一个线程获胜并得到锁,而其他线程被阻塞。
The compiler can observe that there is a sequence of adjacent blocks that operate on the same lock, and merge them into a single block.
编译器可以观察到有一个顺序的相邻块对同一个锁进行操作,并会把它们合并到单一块内。
In fact, when this feature is enabled, and the INSERT operation requires a new or reused block, DB2 will take an exclusive (x) lock on the block in order to add it to the target cell.
实际上,当该特性被启用,并且INSERT操作要求一个新的或重用的块时,DB 2将在块上采用一个独占的(X)锁,以便将它添加到目标单元。
In looking at the code example in Listing 1, one immediate difference between lock and synchronization jumps out — the lock must be released in a finally block.
在查看清单1中的代码示例时,可以看到lock和synchronized有一点明显的区别——lock必须在finally块中释放。
A lock is acquired on entry to a synchronized method or block, and released on exit, even if the exit occurs due to an exception.
当进入一个同步方法或同步块的时候必须获得该锁,而退出的时候(即使是异常退出)必须释放这个锁。
The lock on a computer room door does no good if people block the door open.
将计算机房门锁上并不是好办法,因为人们可以把门打开。
The correct key has notches cut into it that match the wards, which block the wrong key from operating the lock.
正确的项具有切口切成它相匹配的病房,这阻止操作锁错误的关键。
Inside the fuel line, fuel vapor may block the flow of liquid gasoline. This is called vapor lock.
在油管中汽油蒸气会阻碍液态汽油的流动,这称为气阻。
It can block the UV radiation and external pollution effectively, tone the complexion, lock the water, unblock the pores and help the skin to breathe freely.
有效隔离空气污染、调整肤色锁住肌肤水份、轻易揉展,遮瑕同时不阻塞毛孔,让肌肤自由呼吸。
When the thread exits the synchronized block of code, the lock is released, no matter how the thread exits the block.
当执行绪结束程式码的同步化区块时,锁定会被释放,不管执行绪如何结束该区块。
And so pain begets15 invention, and Ian wraps our hands in socks, then we dunk these inside big blue zip-lock bags to block the wind.
正所谓痛苦催生发明,伊恩想了一个新招:先用袜子包住双手,然后把手放入有拉链封口的蓝色大袋子里,以抵御寒风侵袭。
As the fastening device of the disposable lock is realized by relatively simple fastening of bayonet and block groove, technology is simplified;
由于一次性用锁的扣紧装置只用 卡口和卡槽等相对简单的扣接来实现,简化了工艺;
The purpose of the design is to effectively prevent illegal person from using bubble gum to block the lock hole or using tools such as steel needles and the like to open an antitheft door lock.
该技术设计的目的是有效防止违法人员采用泡泡糖,或者使用钢针等类作案工开启防盗门锁。
The purpose of the design is to effectively prevent illegal person from using bubble gum to block the lock hole or using tools such as steel needles and the like to open an antitheft door lock.
该技术设计的目的是有效防止违法人员采用泡泡糖,或者使用钢针等类作案工开启防盗门锁。
应用推荐