View source code
Display the source code in core/thread/threadbase.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.

Module core.thread.threadbase

The threadbase module provides OS-independent code for thread storage and management.

Functions

NameDescription
findLowLevelThread(tid) Check whether a thread was created by createLowLevelThread.
thread_detachByAddr(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.
thread_detachInstance(t) 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.
thread_detachThis() Deregisters the calling thread from use with the runtime. If this routine is called for a thread which is not registered, the result is undefined.
thread_findByAddr(addr) Search the list of all threads for a thread with the given thread identifier.
thread_isMainThread()
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.
thread_postRestartTheWorld() Run the necessary operation required after the world was resumed.
thread_resumeAll() Resume 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 actually resumed.
thread_scanAll(scan) The main entry point for garbage collection. The supplied delegate will be passed ranges representing both stack and register values.
thread_scanAllType(scan) The main entry point for garbage collection. The supplied delegate will be passed ranges representing both stack and register values.
thread_setThis(t) Sets 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 return a sensible value in, for example, TLS destructors. In other words, don't touch this unless you know what you're doing.
thread_stackBottom() Returns the stack bottom of the currently active stack within the calling thread.
thread_stackTop() Returns the stack top of the currently active stack within the calling thread.

Classes

NameDescription
ThreadBase
ThreadError Base class for thread errors to be used for function inside GC when allocations are unavailable.
ThreadException Base class for thread exceptions.

Enums

NameDescription
ScanType Indicates the kind of scan being performed by thread_scanAllType.

Aliases

NameTypeDescription
ScanAllThreadsFn void delegate(void*, void*) The scanning function.
ScanAllThreadsTypeFn void delegate(ScanType, void*, void*) The scanning function.

Authors

Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak

License

Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)