Debian Codegraph @

js/src/threading/posix/ThreadPlatformData.h

raw
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef threading_posix_PlatformData_h
8 #define threading_posix_PlatformData_h
9
10 #include <pthread.h>
11 #include <stdlib.h>
12 #include <string.h>
13
14 #if defined(__APPLE__) && defined(__MACH__)
15 # include <dlfcn.h>
16 #endif
17
18 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
19 # include <pthread_np.h>
20 #endif
21
22 #if defined(__linux__)
23 # include <sys/prctl.h>
24 #endif
25
26 #include "threading/Thread.h"
27
28 namespace js {
29
30 class ThreadId::PlatformData {
31 friend class Thread;
32 friend class ThreadId;
33 pthread_t ptThread;
34
35 // pthread_t does not have a default initializer, so we have to carry a bool
36 // to tell whether it is safe to compare or not.
37 bool hasThread;
38 };
39
40 } // namespace js
41
42 #endif // threading_posix_PlatformData_h