Print this page
8115 parallel zfs mount
   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.

  14  */
  15 
  16 #include <sys/cmn_err.h>
  17 #include <sys/thread.h>
  18 #include <sys/zone.h>

  19 
  20 #define _SYNCH_H        /* keep out <synch.h> */
  21 #include <thread.h>
  22 
  23 /*
  24  * Get the current kthread_t pointer.
  25  */
  26 kthread_t *
  27 _curthread(void)
  28 {
  29         thread_t tid;
  30 
  31         tid = thr_self();
  32         return ((kthread_t *)(uintptr_t)tid);
  33 }
  34 
  35 /*
  36  * Create a thread.
  37  *
  38  * thread_create() blocks for memory if necessary.  It never fails.


 105 zthread_create(
 106     caddr_t stk,
 107     size_t stksize,
 108     void (*func)(),
 109     void *arg,
 110     size_t len,
 111     pri_t pri)
 112 {
 113         kthread_t *t;
 114 
 115         t = thread_create(stk, stksize, func, arg, len, NULL, TS_RUN, pri);
 116 
 117         return (t);
 118 }
 119 
 120 void
 121 zthread_exit(void)
 122 {
 123         thread_exit();
 124         /* NOTREACHED */

























 125 }
   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  14  * Copyright 2017 RackTop Systems.
  15  */
  16 
  17 #include <sys/cmn_err.h>
  18 #include <sys/thread.h>
  19 #include <sys/zone.h>
  20 #include <sys/proc.h>
  21 
  22 #define _SYNCH_H        /* keep out <synch.h> */
  23 #include <thread.h>
  24 
  25 /*
  26  * Get the current kthread_t pointer.
  27  */
  28 kthread_t *
  29 _curthread(void)
  30 {
  31         thread_t tid;
  32 
  33         tid = thr_self();
  34         return ((kthread_t *)(uintptr_t)tid);
  35 }
  36 
  37 /*
  38  * Create a thread.
  39  *
  40  * thread_create() blocks for memory if necessary.  It never fails.


 107 zthread_create(
 108     caddr_t stk,
 109     size_t stksize,
 110     void (*func)(),
 111     void *arg,
 112     size_t len,
 113     pri_t pri)
 114 {
 115         kthread_t *t;
 116 
 117         t = thread_create(stk, stksize, func, arg, len, NULL, TS_RUN, pri);
 118 
 119         return (t);
 120 }
 121 
 122 void
 123 zthread_exit(void)
 124 {
 125         thread_exit();
 126         /* NOTREACHED */
 127 }
 128 
 129 void
 130 tsd_create(uint_t *keyp, void (*destructor)(void *))
 131 {
 132         VERIFY0(thr_keycreate(keyp, destructor));
 133 }
 134 
 135 /*ARGSUSED*/
 136 void
 137 tsd_destroy(uint_t *keyp)
 138 {}
 139 
 140 void *
 141 tsd_get(uint_t key)
 142 {
 143         void *value;
 144 
 145         return (thr_getspecific(key, &value) ? NULL : value);
 146 }
 147 
 148 int
 149 tsd_set(uint_t key, void *value)
 150 {
 151         return (thr_setspecific(key, value));
 152 }