static void unmount_item_proc(mount_ctx *mnt) { if (start_system_thread(unmount_thread_proc, mnt, NULL) != ST_OK) { dc_deref_hook(mnt->hook); mm_pool_free(mnt); } }
int dc_init_fast_crypt() { int i; /* enable thread pool */ if (lock_xchg(&pool_enabled, 1) != 0) { return ST_OK; } /* initialize resources */ ExInitializeNPagedLookasideList( &pool_req_mem, NULL, NULL, 0, sizeof(req_item), '3_cd', 0); KeInitializeEvent(&pool_signal_event, NotificationEvent, FALSE); ExInitializeSListHead(&pool_head); KeInitializeSpinLock(&pool_lock); /* start worker threads */ for (i = 0; i < dc_cpu_count; i++) { if (start_system_thread(dc_worker_thread, NULL, &pool_threads[i]) != ST_OK) { dc_free_fast_crypt(); return ST_ERR_THREAD; } } return ST_OK; }