()
| 21 | } |
| 22 | |
| 23 | public void run() { |
| 24 | for(;;){ // Scheduler will run foerever |
| 25 | CooperativeThread nextThread; |
| 26 | synchronized (threads){ |
| 27 | rrIndex++; |
| 28 | if(rrIndex >= threads.size()) rrIndex = 0; |
| 29 | nextThread = threads.get(rrIndex); |
| 30 | } |
| 31 | nextThread.handleMessage(); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | static abstract class CooperativeThread{ |
nothing calls this directly
no test coverage detected