Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / js / src / threading / ThreadId.h
blob1063d355f262475afabe850b88f7e9a69d0ab717
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/. */
7 #ifndef threading_ThreadId_h
8 #define threading_ThreadId_h
10 namespace js {
12 class ThreadId {
13 class PlatformData;
14 void* platformData_[2];
16 public:
17 ThreadId();
19 ThreadId(const ThreadId&) = default;
20 ThreadId(ThreadId&&) = default;
21 ThreadId& operator=(const ThreadId&) = default;
22 ThreadId& operator=(ThreadId&&) = default;
24 bool operator==(const ThreadId& aOther) const;
25 bool operator!=(const ThreadId& aOther) const { return !operator==(aOther); }
27 MOZ_IMPLICIT operator bool() const;
29 inline PlatformData* platformData();
30 inline const PlatformData* platformData() const;
32 // Return the thread id of the calling thread.
33 static ThreadId ThisThreadId();
36 } // namespace js
38 #endif // threading_ThreadId_h