THREADP_INIT(3T) BSD THREADP_INIT(3T)
NAME
threadp_init - create a new thread context
SYNOPSIS
include <apollo/thread_private.h>
threadp_key_t threadp_init(void)
DESCRIPTION
threadp_init creates a new context and returns the key associated with
it. This key must be shared among all threads who will use the context
created.
Data Type
The data type for Per-Thread-Storage manager calls is defined as follows:
threadp_key_t
This is the key assigned for the context created. It is returned by
threadp_init, and must be shared between all threads using this
particular context.
SEE ALSO
thread_create(3T), thread_terminate(3T), thread_suspend(3T),
thread_resume(3T), thread_abort(3T), thread_self(3T), thread_info(3T),
thread_state(3T), thread_set_priority(3T), thread_handle_signals(3T),
thread_inhibit(3T), thread_cleanup(3T), thread_startup(3T),
threadp_set(3T), threadp_get(3T).
Section (3P) pthread calls (IEEE P1003.4a) calls.
Domain System Software Release Notes, Software Release 10.4
NOTES
This call is one of the Per-Thread-Storage manager calls; these calls are
useful for some thread implementations. The Per-Thread Storage mechanism
allows per-thread context to be stored and retrieved simply. The context
is created using threadp_init and a key is associated with it.
Each thread that wishes to use this context must then allocate its
private data, then call threadp_set with a pointer to it (or the data
itself if it is no larger than a pointer). After this is accomplished,
all calls to threadp_get with this key will produce the context for the
current thread.
This call is provided solely for compatibility with the Mach operating
system. New applications should use the Pthread interface instead.