| 1081 | |
| 1082 | |
| 1083 | static void hash_insert_lock(Lock* lock) |
| 1084 | { |
| 1085 | /************************************** |
| 1086 | * |
| 1087 | * h a s h _ i n s e r t _ l o c k |
| 1088 | * |
| 1089 | ************************************** |
| 1090 | * |
| 1091 | * Functional description |
| 1092 | * Insert the provided lock into the |
| 1093 | * compatibility lock table. |
| 1094 | * |
| 1095 | **************************************/ |
| 1096 | fb_assert(LCK_CHECK_LOCK(lock)); |
| 1097 | |
| 1098 | Jrd::Attachment* const att = lock->getLockAttachment(); |
| 1099 | if (!att) |
| 1100 | return; |
| 1101 | |
| 1102 | // if no identical is returned, place it in the collision list |
| 1103 | |
| 1104 | USHORT hash_slot; |
| 1105 | Lock* identical = hash_get_lock(lock, &hash_slot, 0); |
| 1106 | if (!identical) |
| 1107 | { |
| 1108 | lock->lck_collision = (*att->att_compatibility_table)[hash_slot]; |
| 1109 | (*att->att_compatibility_table)[hash_slot] = lock; |
| 1110 | return; |
| 1111 | } |
| 1112 | |
| 1113 | // place it second in the list, out of pure laziness |
| 1114 | |
| 1115 | lock->lck_identical = identical->lck_identical; |
| 1116 | identical->lck_identical = lock; |
| 1117 | } |
| 1118 | |
| 1119 | |
| 1120 | static bool hash_remove_lock(Lock* lock, Lock** match) |
no test coverage detected