b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * This file and its contents are supplied under the terms of the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Common Development and Distribution License ("CDDL"), version 1.0.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * You may only use this file in accordance with the terms of version
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * 1.0 of the CDDL.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * A full copy of the text of the CDDL should have accompanied this
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * source. A copy of the CDDL is also available via the Internet at
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Get the current kthread_t pointer.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Create a thread.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * thread_create() blocks for memory if necessary. It never fails.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* ARGSUSED */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross void * (*thr_func)(void *);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross cmn_err(CE_PANIC, "thread_create: invalid state");
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross rc = thr_create(NULL, 0, thr_func, arg, thr_flags, &newtid);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross cmn_err(CE_PANIC, "thread_create failed, rc=%d", rc);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross t = thread_create(stk, stksize, func, arg, len, NULL, TS_RUN, pri);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross /* NOTREACHED */