|
|
@ -18,8 +18,7 @@ typedef struct KeyNode_r{ |
|
|
|
bool isNotCurLocked(KeyNode *LockedHead, int KeyIx){ |
|
|
|
KeyNode *temp = LockedHead; |
|
|
|
while (temp != NULL){ |
|
|
|
if (temp->KeyIx == KeyIx) |
|
|
|
return false; |
|
|
|
if (temp->KeyIx == KeyIx) return false; |
|
|
|
temp = temp->next; |
|
|
|
} |
|
|
|
return true; |
|
|
@ -73,6 +72,7 @@ ERL_NIF_TERM tryLock(ErlNifEnv *env, int, const ERL_NIF_TERM argv[]){ |
|
|
|
LockSlot[temp->KeyIx].compare_exchange_strong(RExpected, 0); |
|
|
|
temp = temp->next; |
|
|
|
} |
|
|
|
return atomFalse; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|