
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.
43 lines
984 B
Plaintext
43 lines
984 B
Plaintext
== Why is this an issue?
|
|
|
|
``++Thread.yield++`` is intended to hint to the processor that the current thread is willing to suspended in favor of another thread. Unfortunately, it doesn't have the same results across platforms, thus marring the cross-platform compatibility of any application that uses it.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
public void doSomething() {
|
|
// ...
|
|
Thread.yield(); // Noncompliant
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove this use of "Thread.yield".
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 11 Jun 2015, 19:43:14 Ann Campbell wrote:
|
|
CodePro: Disallow Yield Usage
|
|
|
|
=== on 16 Jun 2015, 17:08:58 Nicolas Peru wrote:
|
|
Looks good
|
|
|
|
=== on 16 Aug 2016, 16:52:57 Ann Campbell wrote:
|
|
Note to self: \http://stackoverflow.com/questions/38978112/thread-yield-still-a-cross-platform-minefield
|
|
|
|
endif::env-github,rspecator-view[]
|