Practice using yield and surrendering time slices - 1

"Hi, Amigo! Keep practicing! Here are a couple of tasks for you."

undefined
7
Task
Java Multithreading, level 5, lesson 11
Locked
Ensuring important operations aren't interrupted
Take a look at the moveMoney() method. If RANDOM.nextInt(5000) is greater than THRESHOLD_VALUE, then ensure the time slice is surrendered (yield the right of way to the current thread). Add this code to the only acceptable place.
undefined
7
Task
Java Multithreading, level 5, lesson 11
Locked
Finagle's first law: if an experiment succeeds, then something went wrong...
Ensure the time slice is surrendered (yield the right of way to the current thread) for consistent console output.