* Return the offset of the first slot without a database connection, or -1 if * all slots are connected. */
| 158 | * all slots are connected. |
| 159 | */ |
| 160 | static int |
| 161 | find_unconnected_slot(const ParallelSlotArray *sa) |
| 162 | { |
| 163 | int i; |
| 164 | |
| 165 | for (i = 0; i < sa->numslots; i++) |
| 166 | { |
| 167 | if (sa->slots[i].inUse) |
| 168 | continue; |
| 169 | |
| 170 | if (sa->slots[i].connection == NULL) |
| 171 | return i; |
| 172 | } |
| 173 | |
| 174 | return -1; |
| 175 | } |
| 176 | |
| 177 | /* |
| 178 | * Return the offset of the first idle slot, or -1 if all slots are busy. |
no outgoing calls
no test coverage detected