return b.getThreadId() - a.getThreadId();

java.long.Long.compare is a JDK7 method, and we need to be compatible with JDK6.