Panda3D
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  */
17 INLINE ThreadSimpleImpl *ThreadSimpleManager::
18 get_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  */
27 INLINE bool ThreadSimpleManager::
28 is_same_system_thread() const {
29  return _current_thread->is_same_system_thread();
30 }
31 
32 /**
33  *
34  */
35 INLINE ThreadSimpleManager *ThreadSimpleManager::
36 get_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  */
46 INLINE bool ThreadSimpleManager::CompareStartTime::
47 operator ()(ThreadSimpleImpl *a, ThreadSimpleImpl *b) const {
48  return a->get_wake_time() > b->get_wake_time();
49 }