| 3182 | |
| 3183 | |
| 3184 | bool LockManager::signal_owner(thread_db* tdbb, own* blocking_owner) |
| 3185 | { |
| 3186 | /************************************** |
| 3187 | * |
| 3188 | * s i g n a l _ o w n e r |
| 3189 | * |
| 3190 | ************************************** |
| 3191 | * |
| 3192 | * Functional description |
| 3193 | * Send a signal to a process. |
| 3194 | * |
| 3195 | * The second parameter is a possible offset to the |
| 3196 | * blocked owner (or NULL), which is passed on to |
| 3197 | * blocking_action(). |
| 3198 | * |
| 3199 | **************************************/ |
| 3200 | ASSERT_ACQUIRED; |
| 3201 | |
| 3202 | // If a process, other than ourselves, hasn't yet seen a signal |
| 3203 | // that was sent, don't bother to send another one |
| 3204 | |
| 3205 | DEBUG_DELAY; |
| 3206 | |
| 3207 | blocking_owner->own_flags |= OWN_signaled; |
| 3208 | DEBUG_DELAY; |
| 3209 | |
| 3210 | prc* const process = (prc*) SRQ_ABS_PTR(blocking_owner->own_process); |
| 3211 | |
| 3212 | // Deliver signal either locally or remotely |
| 3213 | |
| 3214 | if (process->prc_process_id == PID) |
| 3215 | { |
| 3216 | DEBUG_DELAY; |
| 3217 | blocking_action(tdbb, SRQ_REL_PTR(blocking_owner)); |
| 3218 | DEBUG_DELAY; |
| 3219 | return true; |
| 3220 | } |
| 3221 | |
| 3222 | DEBUG_DELAY; |
| 3223 | |
| 3224 | if (m_sharedMemory->eventPost(&process->prc_blocking) == FB_SUCCESS) |
| 3225 | return true; |
| 3226 | |
| 3227 | DEBUG_MSG(1, ("signal_owner - direct delivery failed\n")); |
| 3228 | |
| 3229 | blocking_owner->own_flags &= ~OWN_signaled; |
| 3230 | DEBUG_DELAY; |
| 3231 | |
| 3232 | // We couldn't deliver signal. Let someone to purge the process. |
| 3233 | return false; |
| 3234 | } |
| 3235 | |
| 3236 | |
| 3237 | const USHORT EXPECT_inuse = 0; |