License
Distributed under the
Boost Software License 1.0.
(See accompanying file LICENSE)
The threadbase module provides OS-independent code for thread storage and management.
(See accompanying file LICENSE)
()ThreadBase sm_thisThreadBase sm_mainThreadID m_addrCallable m_callstring m_namesize_t m_szbool m_isDaemonThrowable m_unhandledStackContext m_mainStackContext * m_currbool m_lockprivate void * m_tlsgcdataprivate void * m_tlsrtdatavoid[mutexClassInstanceSize] _slockStackContext * sm_cbegThreadBase sm_tbegsize_t sm_tlenprivate ThreadBase * pAboutToStartprivate size_t nAboutToStartThreadBase prevThreadBase nextvoid initDataStorage() nothrowThrowable join(bool rethrow = true)Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown.bool isDaemon() @property @safe @nogcGets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not pre...void isDaemon(bool val) @property @safe @nogcSets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not pre...bool isMainThread() @property nothrow @nogcTests whether this thread is the main thread, i.e. the thread that initialized the runtimeThreadBase[] getAll()Provides a list of all threads currently being tracked by the system. Note that threads in the returned array might no longer run (see ThreadBase.isRunning).int opApply(scope int delegate(ref ThreadBase) dg)Operates on all threads currently being tracked by the system. The result of deleting any Thread object is undefined. Note that threads passed to the callback might no longer run (see ThreadBase.i...ThreadBase[] getAllImpl(alias resize)()void run()Indicates the kind of scan being performed by thread_scanAllType.
The scanning function.
ditto
void thread_term_tpl(ThreadT, MainThreadStore)(ref MainThreadStore _mainThreadStore) @nogc nothrowTerminates the thread module. No other thread routine may be called afterwards.ThreadT thread_attachThis_tpl(ThreadT)()Registers the calling thread for use with the D Runtime. If this routine is called for a thread which is already registered, no action is performed.void thread_detachThis() nothrow @nogcDeregisters the calling thread from use with the runtime. If this routine is called for a thread which is not registered, the result is undefined.void thread_detachByAddr(ThreadID addr)Deregisters the given thread from use with the runtime. If this routine is called for a thread which is not registered, the result is undefined.ThreadBase thread_findByAddr(ThreadID addr)Search the list of all threads for a thread with the given thread identifier.void thread_setThis(ThreadBase t) nothrow @nogcSets the current thread to a specific reference. Only to be used when dealing with externally-created threads (in e.g. C code). The primary use of this function is when ThreadBase.getThis() must re...void thread_joinAll()Joins all non-daemon threads that are currently running. This is done by performing successive scans through the thread list until a scan consists of only daemon threads.void thread_postRestartTheWorld() nothrowRun the necessary operation required after the world was resumed.void thread_resumeAll() nothrowResume all threads but the calling thread for "stop the world" garbage collection runs. This function must be called once for each preceding call to thread_suspendAll before the threads are actual...void thread_scanAllType(scope ScanAllThreadsTypeFn scan) nothrowThe main entry point for garbage collection. The supplied delegate will be passed ranges representing both stack and register values.void thread_scanAll(scope ScanAllThreadsFn scan) nothrowThe main entry point for garbage collection. The supplied delegate will be passed ranges representing both stack and register values.void onThreadError(string msg) nothrow @nogcA callback for thread errors in D during collections. Since an allocation is not possible a preallocated ThreadError will be used as the Error instancevoid * thread_stackTop() nothrow @nogcReturns the stack top of the currently active stack within the calling thread.void * thread_stackBottom() nothrow @nogcReturns the stack bottom of the currently active stack within the calling thread.bool findLowLevelThread(ThreadID tid) nothrow @nogcCheck whether a thread was created by `createLowLevelThread`.mutexAlign = __traits(classInstanceAlignment, Mutex)mutexClassInstanceSize = __traits(classInstanceSize, Mutex)bool multiThreadedFlaguint suspendDepthsize_t ll_nThreadsll_ThreadData * ll_pThreadsvoid[mutexClassInstanceSize] ll_lock