Panda3D
asyncTaskChain.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 asyncTaskChain.I
10  * @author drose
11  * @date 2006-08-23
12  */
13 
14 /**
15  * Returns true if the thread(s) have been started and are ready to service
16  * requests, false otherwise. If this is false, the next call to add() or
17  * add_and_do() will automatically start the threads.
18  */
19 INLINE bool AsyncTaskChain::
20 is_started() const {
21  return (_state == S_started);
22 }
23 
24 /**
25  * Returns the time at which the next sleeping thread will awaken, or -1 if
26  * there are no sleeping threads. Assumes the lock is already held.
27  */
28 INLINE double AsyncTaskChain::
29 do_get_next_wake_time() const {
30  if (!_sleeping.empty()) {
31  return _sleeping.front()->_wake_time;
32  }
33  return -1.0;
34 }
35 
36 /**
37  * Returns the time at which the indicated thread will awaken. Assumes the
38  * lock is already held.
39  */
40 INLINE double AsyncTaskChain::
41 get_wake_time(AsyncTask *task) {
42  return task->_wake_time;
43 }
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:32
bool is_started() const
Returns true if the thread(s) have been started and are ready to service requests,...