private static System.Diagnostics.ThreadWaitReason ConvertOsxThreadFlagsToWaitReason(Interop.libproc.ThreadFlags flags)
{
// Since ThreadWaitReason isn't a flag, we have to do a mapping and will lose some information.
if ((flags & Interop.libproc.ThreadFlags.TH_FLAGS_SWAPPED) == Interop.libproc.ThreadFlags.TH_FLAGS_SWAPPED)
return System.Diagnostics.ThreadWaitReason.PageOut;
else
return System.Diagnostics.ThreadWaitReason.Unknown; // There isn't a good mapping for anything else
}
}