register the fact that thd is not waiting anymore decrease waiter_count, clear waiting_for, free the resource if appropriate. thd->waiting_for must be locked! */
| 959 | thd->waiting_for must be locked! |
| 960 | */ |
| 961 | static int stop_waiting_locked(WT_THD *thd) |
| 962 | { |
| 963 | int ret; |
| 964 | WT_RESOURCE *rc= thd->waiting_for; |
| 965 | DBUG_ENTER("stop_waiting_locked"); |
| 966 | |
| 967 | DBUG_ASSERT(rc->waiter_count); |
| 968 | DBUG_ASSERT(rc->state == ACTIVE); |
| 969 | rc->waiter_count--; |
| 970 | thd->waiting_for= 0; |
| 971 | ret= unlock_lock_and_free_resource(thd, rc); |
| 972 | DBUG_RETURN((thd->killed || ret) ? WT_DEADLOCK : WT_OK); |
| 973 | } |
| 974 | |
| 975 | /** |
| 976 | register the fact that thd is not waiting anymore |
no test coverage detected