该方法线程是否安全?
Very lightweight and non thread safe.
很轻量但是并不是线程安全的。
Note that this code is fully thread safe.
注意这样的代码是完全线程安全的。
Consider for example usage of the thread safe StringBuffer.
举例来说,考虑一下线程安全的StringBuffer的用法。
What this means is that the following code is not thread safe!
这表示下面的代码不是线程安全的。
In situations where you know you need thread safety, use a thread-safe view.
在需要线程安全的情况下,请使用线程安全视图。
The object pool needs to keep track of the state of each object and to be thread safe.
对象池需要跟踪每个对象的状态,而且应该是线程安全的。
It is designed to be thread safe (though this is not really true yet), and Multi-VM capable.
它被设计成线程安全的(尽管还没有达到真正的线程安全),并能支持多个虚拟机。
The index writer however, is thread safe, so you can update the index while people are searching it.
而索引写者是线程级安全的,所以你能在人们搜索它时更新索引。
Making a class thread safe requires additional care during the implementation and testing of the class.
使一个类线程安全需要在实现和测试该类时非常小心。
Consider a thread-safe container class - a data structure that guarantees thread safety to its clients.
可以考虑使用一个线程安全容器类—一个保证用户操作线程安全的数据结构。
In this example, I don't focus on other issues related to this pattern, such as synchronization to make it thread safe.
在此实例中,我并没有针对其他与此模式相关的问题,如保持同步以确保线程安全。
You should also remember that static classes that preserve state between method calls should be made thread safe by default.
您还应该记得,在方法调用之间保留状态的静态类在默认情况下应该是线程安全的。
Because of the stateful way propagation tracks which (successively less specific) rules have been called, a dispatcher is not thread safe.
由于传播采用有状态方式跟踪调用了哪些(依次不太特定的)规则,所以分派器不是线程安全的。
Since it is thread safe by design, you might cache it in a public static final variable, or wrap it in a singleton pattern after creation for later access.
因为根据设计它是线程安全的,创建它之后可以把它缓存在一个公共静态最终变量中,或者包装在单实例模式中以供以后访问。
A primary concern in multithreaded programming is to make sure the program runs correctly — thread safe — in a system where multiple threads are executing.
多线程编程中的一个主要考虑是确保程序在执行多线程的系统中正确地——线程安全地——运行。
On the surface it looks as though lock elision allows us to write thread safe code without any synchronization penalty for using in cases where it really wasn't needed.
从表面上看,锁省略似乎可以允许我们不必忍受同步带来的负担,就可以编写线程安全的代码了,前提是在同步的确是多余的情况下。
This instance is used for all messages that are sent into the partition, making members of this class thread safe and providing the opportunity to cache required resources.
这个实例被用于发送到该分区中的所有消息,使这个类的成员线程安全并提供缓存必要资源的机会。
Any objects touched by listeners should either be thread safe or, for thread-confined objects such as Swing models, the listener should be confident that it is executing in the right thread.
侦听器涉及的任何对象,都应当是线程安全的,或者是受线程约束的对象(例如Swing模型),侦听器应当确定自己正在正确的线程中执行。
In this article, you'll learn how to build a thread-safe data repository for keeping auto-saved form data.
在本文中,您将学习如何构建线程安全的数据存储库来自动保存表单数据。
A class that is not thread-safe can often be used safely in a multithreaded program as long as you ensure that instances of that class used by one thread are not used by other threads.
非线程安全类通常可以安全地在多线程程序中使用,只要您能确保一个线程所用的类的实例不被其它线程使用。
One advantage of immutable classes is that they are thread-safe.
(不可变类的一个优点就是它们是线程安全的)。
Listing 3 shows you how to use this thread-safe version.
清单3说明如何使用此线程安全版本。
Objects that you put on the session should be thread-safe and serializable.
放到会话中的对象应该是线程安全的和可序列化的。
Moreover, it may be impossible to make a non-reentrant function thread-safe.
另外,或许不可能让某个不可重入的函数是线程安全的。
Using a thread-safe wrapper for the data repository.
为数据存储库使用线程安全的包装器。
Batch application developers write code that is thread-safe and executes on a single thread.
批处理应用程序开发人员可以编写线程安全的、且在单个线程中执行的代码。
One common use is for storing a singleton of a type that is not thread-safe.
一种常见用法是用于存储非线程安全类型的单例。
IBinder methods must, therefore, be implemented to be thread-safe.
因此ibinder方法必须实现为线程安全的。
IBinder methods must, therefore, be implemented to be thread-safe.
因此ibinder方法必须实现为线程安全的。
应用推荐