42 void (*func)(
void *),
void *arg,
const char *namefmt, ...)
51 va_start(varargs, namefmt);
52 result = vsnprintf(
q->t_namebuf,
sizeof q->t_namebuf, namefmt, varargs);
55 "namebuf truncated to \"%s\"",
q->t_namebuf);
69 q->t_tls.tls_m0_instance =
m0_get();
70 q->t_tls.tls_self =
q;
76 if (
q->t_init !=
NULL) {
M0_INTERNAL int m0_thread_init_impl(struct m0_thread *q, const char *name)
static struct m0_semaphore q
int m0_thread_join(struct m0_thread *q)
M0_INTERNAL void m0_set(struct m0 *instance)
struct m0 * tls_m0_instance
struct m0_thread_tls t_tls
struct m0_semaphore t_wait
M0_INTERNAL struct m0 * m0_get(void)
M0_INTERNAL int m0_thread_adopt(struct m0_thread *thread, struct m0 *instance)
M0_INTERNAL struct m0_thread_tls * m0_thread_tls(void)
static struct m0_thread t[NR]
M0_INTERNAL void m0_addb2_global_thread_leave(void)
M0_INTERNAL void * m0_thread_trampoline(void *arg)
int m0_thread_init(struct m0_thread *q, int(*init)(void *), void(*func)(void *), void *arg, const char *namefmt,...)
M0_INTERNAL void m0_addb2_global_thread_enter(void)
void m0_thread_fini(struct m0_thread *q)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
M0_INTERNAL void m0_thread_shun(void)
int init(struct workload *w)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
M0_INTERNAL struct m0_thread * m0_thread_self(void)
static struct m0 instance
#define M0_ASSERT_INFO(cond, fmt,...)
struct m0_thread * tls_self
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
M0_INTERNAL int m0_thread_arch_adopt(struct m0_thread *thread, struct m0 *instance, bool full)
M0_INTERNAL void m0_thread_arch_shun(void)
enum m0_thread_state t_state