Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public class Thread implements Runnable
/** Thread local storage. Package accessible for use by
* InheritableThreadLocal.
*/
final ThreadLocalMap locals;
ThreadLocalMap locals;

/** The uncaught exception handler. */
UncaughtExceptionHandler exceptionHandler;
Expand Down Expand Up @@ -1073,7 +1073,10 @@ synchronized void die()
*/
static ThreadLocalMap getThreadLocals()
{
return currentThread().locals;
Thread t = currentThread();
if (t.locals == null)
t.locals = new ThreadLocalMap();
return t.locals;
}

/**
Expand Down
Loading