| 893 | |
| 894 | |
| 895 | static bool compatible(const Lock* lock1, const Lock* lock2, USHORT level2) |
| 896 | { |
| 897 | /************************************** |
| 898 | * |
| 899 | * c o m p a t i b l e |
| 900 | * |
| 901 | ************************************** |
| 902 | * |
| 903 | * Functional description |
| 904 | * Given two locks, and a desired level for the |
| 905 | * second lock, determine whether the two locks |
| 906 | * would be compatible. |
| 907 | * |
| 908 | **************************************/ |
| 909 | |
| 910 | fb_assert(LCK_CHECK_LOCK(lock1)); |
| 911 | fb_assert(LCK_CHECK_LOCK(lock2)); |
| 912 | |
| 913 | // if the locks have the same compatibility block, |
| 914 | // they are always compatible regardless of level |
| 915 | |
| 916 | if (lock1->lck_compatible && lock2->lck_compatible && lock1->lck_compatible == lock2->lck_compatible) |
| 917 | { |
| 918 | // check for a second level of compatibility as well: |
| 919 | // if a second level was specified, the locks must also be compatible at the second level |
| 920 | |
| 921 | if (!lock1->lck_compatible2 || !lock2->lck_compatible2 || |
| 922 | lock1->lck_compatible2 == lock2->lck_compatible2) |
| 923 | { |
| 924 | return true; |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | return compatibility[lock1->lck_logical][level2]; |
| 929 | } |
| 930 | |
| 931 | |
| 932 | static void enqueue(thread_db* tdbb, CheckStatusWrapper* statusVector, Lock* lock, USHORT level, SSHORT wait) |
no outgoing calls
no test coverage detected