Advertisement
Guest User

Untitled

a guest
May 29th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. // ----------------------- Start Debugger Method ---------------------------
  2. // Provide a simple debugger of the TCBs in queue
  3. // Format of output is = Q[]-> { [p,t] [p,t] [p,t] ... }
  4. // Where p = Process ID
  5. // t = Thread ID
  6. // -------------------------------------------------------------------------
  7. private void dumpQueue(int time) {
  8. if (DEBUG) {
  9. System.out.print("\nT("+time+"): ");
  10. // how many TCBs are in queue
  11. int N = queue.size();
  12.  
  13. System.out.print("Q[]-> {");
  14. // print out TCBs in addition to Scheduler TCB
  15. for(int j=0; j < N; j++) {
  16. TCB t = (TCB)queue.get(j);
  17. //if(t.getTid() != 0)
  18. // System.out.print(" ["+t.getPid()+","+t.getTid()+":"+t.getThread());
  19. System.out.print(" ["+t.getPid()+","+t.getTid()+"]");
  20. }
  21. System.out.print(" } ");
  22. // }
  23. }
  24. }
  25. // ----------------------- End Debugger Method -----------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement