| 1182 | |
| 1183 | |
| 1184 | static void internal_ast(Lock* lock) |
| 1185 | { |
| 1186 | /************************************** |
| 1187 | * |
| 1188 | * i n t e r n a l _ a s t |
| 1189 | * |
| 1190 | ************************************** |
| 1191 | * |
| 1192 | * Functional description |
| 1193 | * Deliver blocking asts to all locks identical to |
| 1194 | * the passed lock. This routine is called to downgrade |
| 1195 | * all other locks in the same process which do not have |
| 1196 | * the lck_compatible field set. |
| 1197 | * Note that if this field were set, the internal lock manager |
| 1198 | * should not be able to generate a lock request which blocks |
| 1199 | * on our own process. |
| 1200 | * |
| 1201 | **************************************/ |
| 1202 | fb_assert(LCK_CHECK_LOCK(lock)); |
| 1203 | |
| 1204 | // go through the list, saving the next lock in the list |
| 1205 | // in case the current one gets deleted in the ast |
| 1206 | |
| 1207 | Lock* next; |
| 1208 | for (Lock* match = hash_get_lock(lock, 0, 0); match; match = next) |
| 1209 | { |
| 1210 | next = match->lck_identical; |
| 1211 | |
| 1212 | // don't deliver the ast to any locks which are already compatible |
| 1213 | |
| 1214 | if (match != lock && !compatible(match, lock, lock->lck_logical) && match->lck_ast) |
| 1215 | { |
| 1216 | (*match->lck_ast)(match->lck_object); |
| 1217 | } |
| 1218 | } |
| 1219 | } |
| 1220 | |
| 1221 | |
| 1222 |
no test coverage detected