Lines Matching defs:thread

380 	 * since will be doing it in a separate kernel thread.
406 * wake thread so it can cleanup and wait for it to exit so we can
426 * for the user app to exit. Notify the thread waiting that the app
468 * wake thread, thread handles guest requests and user app
579 /* wake thread to see if there are requests already queued up */
673 * user thread will spin in poll requests before getting to
718 /* initialize user ring, thread, mapping state */
760 /* wake thread, thread handles guest requests and user app responses */
905 * initialize the thread we use to process guest requests and user
952 xpvtap_user_thread_t *thread;
956 thread = &state->bt_thread;
958 mutex_init(&thread->ut_mutex, NULL, MUTEX_DRIVER, NULL);
959 cv_init(&thread->ut_wake_cv, NULL, CV_DRIVER, NULL);
960 cv_init(&thread->ut_exit_done_cv, NULL, CV_DRIVER, NULL);
961 thread->ut_wake = B_FALSE;
962 thread->ut_exit = B_FALSE;
963 thread->ut_exit_done = B_TRUE;
965 /* create but don't start the user thread */
967 thread->ut_taskq = ddi_taskq_create(state->bt_dip, taskqname, 1,
969 if (thread->ut_taskq == NULL) {
976 ddi_taskq_destroy(thread->ut_taskq);
978 cv_destroy(&thread->ut_exit_done_cv);
979 cv_destroy(&thread->ut_wake_cv);
980 mutex_destroy(&thread->ut_mutex);
992 xpvtap_user_thread_t *thread;
998 thread = &state->bt_thread;
1000 /* start the user thread */
1001 thread->ut_exit_done = B_FALSE;
1002 e = ddi_taskq_dispatch(thread->ut_taskq, xpvtap_user_thread, state,
1005 thread->ut_exit_done = B_TRUE;
1006 cmn_err(CE_WARN, "Unable to start user thread\n");
1017 /* wake thread so it can exit */
1079 xpvtap_user_thread_t *thread;
1089 thread = &state->bt_thread;
1093 mutex_enter(&thread->ut_mutex);
1094 if (thread->ut_exit) {
1095 thread->ut_exit_done = B_TRUE;
1097 mutex_exit(&thread->ut_mutex);
1105 if (!thread->ut_wake) {
1106 e = cv_wait_sig(&thread->ut_wake_cv, &thread->ut_mutex);
1107 if ((e == 0) || (thread->ut_exit)) {
1108 thread->ut_exit = B_TRUE;
1109 mutex_exit(&thread->ut_mutex);
1114 /* if someone didn't wake us, go back to the start of the thread */
1115 if (!thread->ut_wake) {
1116 mutex_exit(&thread->ut_mutex);
1121 thread->ut_wake = B_FALSE;
1122 mutex_exit(&thread->ut_mutex);
1155 } while (!thread->ut_exit);
1176 } while (!thread->ut_exit);