History log of /libcore/luni/src/test/java/libcore/java/lang/ThreadTest.java
Revision Date Author Comments
4d8dc721410a0bf120893ded7a9bf684a962de54 26-Oct-2016 Artem Udovichenko <artem.u@samsung.com> Throw IllegalThreadStateException when Thread.start is used in wrong way

Test: run libcore.java.lang.ThreadTest

Change-Id: Ie9bb8aaed5aec6bbe22d4d868ea0b0fa4853ff18
b62710c762bf399ee1a45821eb0740b2d9c92f62 21-Jul-2016 Tobias Thierer <tobiast@google.com> Ensure apps cannot prevent uncaught exceptions being logged.

Add a new @hide API to set an additional UncaughtExceptionHandler that
is called before dispatching to the regular handler. The framework
uses this to enforce logging.

Test: Ran ThreadTest.

Bug: 29624607
Change-Id: Ieb8d70662f7a37e9bfcdeb2818bf4863bb6c1890
bf34d8378762aa4d97c30c86ef95502e5d85ed3e 27-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix Unsafe#park for large wait-time values.

jsr166.LockSupportTest#testParkNeg_parkUntilBlocker
fails if the delay between the tests
System.currentTimeMillis is called at least 2ms behind
the Unsafe#park. This is caused by underflow to
large positive value when subtracting current time
from the method argument.

This change fixes it by not doing subtraction before
comparison.

parkUntil takes arguments in milliseconds and is implemented
as a call to parkFor, which takes arguments in nanoseconds.
If parkUntil argument will overflow during conversion to
nanoseconds, it's clamped on max value (~292 years).

Bug: 29746125
Change-Id: Ie0b3923ce4567415bf6478552c51eb31ac4aec62
b814d44b43f5735503eb5c64cf57f9e5e758c0e1 29-Jun-2016 Neil Fuller <nfuller@google.com> Remove an infinite loop / put a Thread out of its misery

ThreadTest.testGetStackTrace() created a thread that never
terminated due to a for loop with a missing increment.

The loop was unnecessary and has been removed.

Change-Id: If00018b6330fe1340c293585fb9d64206dd89e20
Test: Ran the CTS tests
Bug: 29820565
2047ef0b5d272a03297dc1cd307a2dcfa42e280b 23-Mar-2016 Narayan Kamath <narayan@google.com> Thread: Don't set native names twice for attached threads.

ART already does this when a threads are attached. There's no need
to do it another time.

Also add a test that documents the behaviour wrt. to thread naming
for attached threads.

bug: 27748318

(cherry picked from commit 81888044c73382ef87285593afdf80e840288b06)

Change-Id: I8b1ac9407114d0fc399a3bc644d45e2f00ef7200
81888044c73382ef87285593afdf80e840288b06 23-Mar-2016 Narayan Kamath <narayan@google.com> Thread: Don't set native names twice for attached threads.

ART already does this when a threads are attached. There's no need
to do it another time.

Also add a test that documents the behaviour wrt. to thread naming
for attached threads.

bug: 27748318

Change-Id: I9075f0434b0168280662a1f8a4176f23724748a7
b5a43a8ad530a60469bf9244a157079c93c07c8b 11-Feb-2014 Brian Carlstrom <bdc@google.com> Fix Thread.sleep(0) of an interrupted thread

Bug: 12929305
Change-Id: I3061c3345c68de8bcf438e6935446b4f7cd76001
c3d53e68cbf91fb4c16abb88f8bf8a8e4be4d706 22-Nov-2011 Jesse Wilson <jessewilson@google.com> Add tests to check for a valid context class loader.

(cherry picked from commit cac9b2d67f4570af232bfbf7f065a92878cd3350)

Change-Id: I713fc13be90cdbb13a71ea19502a641f3c1360cb
b20185245f53374b3a86705ac152fd88e4bddec5 15-Jul-2011 jeffhao <jeffhao@google.com> Changed Thread.sleep from native to java implementation.

The change removes a global monitor that was being used in the native
sleep method. Part of a multi-project commit.

(cherry picked from commit 39409c767f8e15bd81f32808a2d4ec2796a2c3aa)

Change-Id: Ib8afaea8eb35202bdec29be3d23cf2e90a70197f
0647bfed6eda99ad77b2dfe8e3696e3fabfaf3cc 13-Dec-2011 Jesse Wilson <jessewilson@google.com> Bring more tests from frameworks/base/tests/CoreTests into libcore.

Bug: http://b/3073226
Change-Id: I66f88f2bfaadd39e53b2977606731e8579d880b6
1a9cff8f68deffd618c5cba1f22f0fb0e396e067 17-Nov-2011 Jesse Wilson <jessewilson@google.com> Always trigger finalization the same way in our tests.

This came up when I was recently writing a ZipFile finalization test
and I needed to copy-paste the finalizer recipe.

Change-Id: Ia67061b3dba1a7011c93c9a81e2a963876b238a1
be013ce620f6d3bd24f7f0b631a36f70197ac3e3 23-Oct-2010 Jesse Wilson <jessewilson@google.com> Change ThreadGroup to no longer hold strong references to threads.

This is intended to fix an issue where threads were leaking when
they weren't started.

This changes a lot of the internals of ThreadGroup, taking advantage
of a new utility method dereferenceIterable that turns a collection
of references into the corresponding iterable of referents.

Change-Id: I8d96c79b4ee30c557276854b38149b9131b656ee
http://b/1937448