}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * MXUserCurrentRank --
+ *
+ * Return the highest rank held by the current thread via MXUser locks.
+ *
+ * Results:
+ * As above
+ *
+ * Side effects:
+ * None
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+MX_Rank
+MXUserCurrentRank(void)
+{
+ MXUserPerThread *perThread;
+ MX_Rank maxRank = RANK_UNRANKED;
+
+ perThread = MXUserGetPerThread(MXUserGetNativeTID(), FALSE);
+
+ if (perThread != NULL) {
+ uint32 i;
+
+ for (i = 0; i < perThread->locksHeld; i++) {
+ MXUserHeader *chkHdr = perThread->lockArray[i];
+
+ maxRank = MAX(chkHdr->rank, maxRank);
+ }
+ }
+
+ return maxRank;
+}
+
+
/*
*-----------------------------------------------------------------------------
*
}
#endif
+MX_Rank MXUserCurrentRank(void);
+
extern void MXUserInstallMxHooks(void (*theLockListFunc)(void),
MX_Rank (*theRankFunc)(void),
void (*theLockFunc)(struct MX_MutexRec *lock),