14 lines
405 B
Plaintext
14 lines
405 B
Plaintext
``++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
|
|
|
|
----
|
|
public void doSomething() {
|
|
// ...
|
|
Thread.yield(); // Noncompliant
|
|
// ...
|
|
}
|
|
----
|
|
|