639 #if !defined(lint)
640 _NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, cpr_info))
641 _NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, sw_cmd_count))
642 #endif
643 /*
644 * the scsi watch thread:
645 * it either wakes up if there is work to do or if the cv_timeait
646 * timed out
647 * normally, it wakes up every <delay> seconds and checks the list.
648 * the interval is not very accurate if the cv was signalled but that
649 * really doesn't matter much
650 * it is more important that we fire off all TURs simulataneously so
651 * we don't have to wake up frequently
652 */
653 static void
654 scsi_watch_thread()
655 {
656 struct scsi_watch_request *swr, *next;
657 clock_t last_delay = 0;
658 clock_t next_delay = 0;
659 clock_t onesec = drv_usectohz(1000000);
660 clock_t exit_delay = 60 * onesec;
661
662 SW_DEBUG((dev_info_t *)NULL, sw_label, SCSI_DEBUG,
663 "scsi_watch_thread: Entering ...\n");
664
665 #if !defined(lint)
666 _NOTE(NO_COMPETING_THREADS_NOW);
667 #endif
668 mutex_init(&cpr_mutex, NULL, MUTEX_DRIVER, NULL);
669 CALLB_CPR_INIT(&cpr_info,
670 &cpr_mutex, callb_generic_cpr, "scsi_watch");
671 sw_cpr_flag = 0;
672 #if !defined(lint)
673 /*LINTED*/
674 _NOTE(COMPETING_THREADS_NOW);
675 #endif
676 /*
677 * grab the mutex and wait for work
678 */
679 mutex_enter(&sw.sw_mutex);
|
639 #if !defined(lint)
640 _NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, cpr_info))
641 _NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, sw_cmd_count))
642 #endif
643 /*
644 * the scsi watch thread:
645 * it either wakes up if there is work to do or if the cv_timeait
646 * timed out
647 * normally, it wakes up every <delay> seconds and checks the list.
648 * the interval is not very accurate if the cv was signalled but that
649 * really doesn't matter much
650 * it is more important that we fire off all TURs simulataneously so
651 * we don't have to wake up frequently
652 */
653 static void
654 scsi_watch_thread()
655 {
656 struct scsi_watch_request *swr, *next;
657 clock_t last_delay = 0;
658 clock_t next_delay = 0;
659 clock_t onesec = drv_sectohz(1);
660 clock_t exit_delay = 60 * onesec;
661
662 SW_DEBUG((dev_info_t *)NULL, sw_label, SCSI_DEBUG,
663 "scsi_watch_thread: Entering ...\n");
664
665 #if !defined(lint)
666 _NOTE(NO_COMPETING_THREADS_NOW);
667 #endif
668 mutex_init(&cpr_mutex, NULL, MUTEX_DRIVER, NULL);
669 CALLB_CPR_INIT(&cpr_info,
670 &cpr_mutex, callb_generic_cpr, "scsi_watch");
671 sw_cpr_flag = 0;
672 #if !defined(lint)
673 /*LINTED*/
674 _NOTE(COMPETING_THREADS_NOW);
675 #endif
676 /*
677 * grab the mutex and wait for work
678 */
679 mutex_enter(&sw.sw_mutex);
|