
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
51 lines
869 B
Plaintext
51 lines
869 B
Plaintext
== Why is this an issue?
|
|
|
|
Naming a thread won't make it run faster or more reliably, but it will make it easier to deal with if you need to debug the application.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
Thread t1 = new Thread(new Runnable() {
|
|
// ...
|
|
};
|
|
t1.start(); // Noncompliant; this thread wasn't named
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,java]
|
|
----
|
|
Thread t1 = new Thread(new Runnable() {
|
|
// ...
|
|
};
|
|
t1.setName("t1");
|
|
t1.start();
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Name this thread to ease debugging and profiling.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 11 Jun 2015, 19:37:06 Ann Campbell wrote:
|
|
CodePro: Disallow Unnamed Thread Usage
|
|
|
|
=== on 16 Jun 2015, 17:09:38 Nicolas Peru wrote:
|
|
Looks good.
|
|
|
|
endif::env-github,rspecator-view[]
|