d: Merge upstream dmd, druntime 4ca4140e58, phobos 454dff14d.
[official-gcc.git] / libphobos / libdruntime / core / thread / types.d
blobeb84ad74b48142c2f2c95458d62f2001e1c7c7ac
1 /**
2 * This module provides types and constants used in thread package.
4 * Copyright: Copyright Sean Kelly 2005 - 2012.
5 * License: Distributed under the
6 * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
7 * (See accompanying file LICENSE)
8 * Authors: Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
9 * Source: $(DRUNTIMESRC core/thread/osthread.d)
12 module core.thread.types;
14 /**
15 * Represents the ID of a thread, as returned by $(D Thread.)$(LREF id).
16 * The exact type varies from platform to platform.
18 version (Windows)
19 alias ThreadID = uint;
20 else
21 version (Posix)
23 import core.sys.posix.pthread;
25 alias ThreadID = pthread_t;
28 struct ll_ThreadData
30 ThreadID tid;
31 version (Windows)
32 void delegate() nothrow cbDllUnload;
35 version (GNU)
37 version (GNU_StackGrowsDown)
38 enum isStackGrowingDown = true;
39 else
40 enum isStackGrowingDown = false;
42 else
44 // this should be true for most architectures
45 enum isStackGrowingDown = true;
48 package
50 version (Posix) static immutable size_t PTHREAD_STACK_MIN;
53 shared static this()
55 version (Posix)
57 import core.sys.posix.unistd;
59 PTHREAD_STACK_MIN = cast(size_t)sysconf(_SC_THREAD_STACK_MIN);