rspec/rules/S3049/java/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
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.
2023-05-25 14:18:12 +02:00

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[]