/* if we're here, all clear to set the lock */
lockp->flags |= OSI_LOCKFLAG_EXCL;
}
+ lockp->tid = thrd_Current();
LeaveCriticalSection(csp);
}
osi_assertx(lockp->flags & OSI_LOCKFLAG_EXCL, "mutex not held");
lockp->flags &= ~OSI_LOCKFLAG_EXCL;
+ lockp->tid = 0;
if (!osi_TEmpty(&lockp->d.turn)) {
osi_TSignalForMLs(&lockp->d.turn, 0, csp);
}
*/
mp->type = 0;
mp->flags = 0;
+ mp->tid = 0;
mp->atomicIndex = osi_MUTEXHASH(mp);
osi_TInit(&mp->d.turn);
return;
char type; /* for all types; type 0 uses atomic count */
char flags; /* flags for base type */
unsigned short atomicIndex; /* index of lock for low-level sync */
+ thread_t tid; /* tid of thread that owns the lock */
unsigned short waiters; /* waiters */
unsigned short pad;
union {