Returns a per-thread singleton function. f is a function of no
arguments that creates and returns some object. The singleton
function will call f only once for each thread, and cache its value
for subsequent calls from the same thread. This allows you to
safely and lazily initialize shared objects on a per-thread basis.
Warning: due to a bug in JDK 5, it may not be safe to use a
per-thread-singleton in the initialization function for another
per-thread-singleton. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5025230
Comments top
No comments for per-thread-singleton. Log in to add a comment.