| 758 | } |
| 759 | |
| 760 | static void |
| 761 | intr_handler_barrier(struct intr_handler *handler) |
| 762 | { |
| 763 | struct intr_event *ie; |
| 764 | |
| 765 | ie = handler->ih_event; |
| 766 | mtx_assert(&ie->ie_lock, MA_OWNED); |
| 767 | KASSERT((handler->ih_flags & IH_DEAD) == 0, |
| 768 | ("update for a removed handler")); |
| 769 | |
| 770 | if (ie->ie_thread == NULL) { |
| 771 | intr_event_barrier(ie); |
| 772 | return; |
| 773 | } |
| 774 | if ((handler->ih_flags & IH_CHANGED) == 0) { |
| 775 | handler->ih_flags |= IH_CHANGED; |
| 776 | intr_event_schedule_thread(ie); |
| 777 | } |
| 778 | while ((handler->ih_flags & IH_CHANGED) != 0) |
| 779 | msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); |
| 780 | } |
| 781 | |
| 782 | /* |
| 783 | * Sleep until an ithread finishes executing an interrupt handler. |
no test coverage detected