Panda3D
Loading...
Searching...
No Matches
threadSimpleManager.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file threadSimpleManager.I
10 * @author drose
11 * @date 2007-06-19
12 */
13
14/**
15 *
16 */
17INLINE ThreadSimpleImpl *ThreadSimpleManager::
18get_current_thread() {
19 return _current_thread;
20}
21
22/**
23 * Returns true if we are still running within the same OS-level thread we
24 * think we should be running in, or false if this appears to be running in a
25 * different thread.
26 */
27INLINE bool ThreadSimpleManager::
28is_same_system_thread() const {
29 return _current_thread->is_same_system_thread();
30}
31
32/**
33 *
34 */
35INLINE ThreadSimpleManager *ThreadSimpleManager::
36get_global_ptr() {
37 if (!_pointers_initialized) {
38 init_pointers();
39 }
40 return _global_ptr;
41}
42
43/**
44 * STL function object to sort the priority queue of sleeping threads.
45 */
46INLINE bool ThreadSimpleManager::CompareStartTime::
47operator ()(ThreadSimpleImpl *a, ThreadSimpleImpl *b) const {
48 return a->get_wake_time() > b->get_wake_time();
49}