Lines Matching refs:new_work
2233 pm_dep_wk_t *new_work;
2235 new_work = kmem_zalloc(sizeof (pm_dep_wk_t), KM_SLEEP);
2236 new_work->pdw_type = cmd;
2237 new_work->pdw_wait = wait;
2238 new_work->pdw_done = 0;
2239 new_work->pdw_ret = 0;
2240 new_work->pdw_pwr = cached_pwr;
2241 cv_init(&new_work->pdw_cv, NULL, CV_DEFAULT, NULL);
2243 new_work->pdw_keeper = kmem_zalloc(strlen(keeper) + 1,
2245 (void) strcpy(new_work->pdw_keeper, keeper);
2248 new_work->pdw_kept = kmem_zalloc(strlen(kept) + 1, KM_SLEEP);
2249 (void) strcpy(new_work->pdw_kept, kept);
2253 pm_dep_thread_workq = new_work;
2254 pm_dep_thread_tail = new_work;
2255 new_work->pdw_next = NULL;
2257 pm_dep_thread_tail->pdw_next = new_work;
2258 pm_dep_thread_tail = new_work;
2259 new_work->pdw_next = NULL;
2264 while (!new_work->pdw_done)
2265 cv_wait(&new_work->pdw_cv, &pm_dep_thread_lock);
2270 *res = new_work->pdw_ret;
2275 if (new_work->pdw_keeper)
2276 kmem_free(new_work->pdw_keeper,
2277 strlen(new_work->pdw_keeper) + 1);
2278 if (new_work->pdw_kept)
2279 kmem_free(new_work->pdw_kept,
2280 strlen(new_work->pdw_kept) + 1);
2281 kmem_free(new_work, sizeof (pm_dep_wk_t));