MCPcopy Create free account
hub / github.com/cztomczak/cefpython / PlatformThreadRef

Class PlatformThreadRef

src/include/base/cef_platform_thread.h:68–82  ·  view source on GitHub ↗

Used for thread checking and debugging. Meant to be as fast as possible. These are produced by PlatformThread::CurrentRef(), and used to later check if we are on the same thread or not by using ==. These are safe to copy between threads, but can't be copied to another process as they have no meaning there. Also, the internal identifier can be re-used after a thread dies, so a PlatformThreadRef can

Source from the content-addressed store, hash-verified

66// after a thread dies, so a PlatformThreadRef cannot be reliably used
67// to distinguish a new thread from an old, dead thread.
68class PlatformThreadRef {
69 public:
70 typedef cef_platform_thread_handle_t RefType;
71
72 PlatformThreadRef() : id_(0) {}
73
74 explicit PlatformThreadRef(RefType id) : id_(id) {}
75
76 bool operator==(PlatformThreadRef other) const { return id_ == other.id_; }
77
78 bool is_null() const { return id_ == 0; }
79
80 private:
81 RefType id_;
82};
83
84// A namespace for low-level thread functions.
85// Chromium uses a class with static methods but CEF uses an actual namespace

Callers 1

CurrentRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected