> Try the module below.  It makes ThreadId an instance of Eq and Ord.

PS: I forgot you also need a C function


#include TSO.h  /* in ghc/includes */

cmp_thread( StgTSO *tso1, *tso2 ) {
  StgThreadID id1 = tso1->id;
  StgThreadId id2 = tso2->id;

  if (tso1 < tso2) return (-1);
  if (tso1 > tso2) return 1;
  return 0
}

Reply via email to