forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasyncTaskChain.I
More file actions
43 lines (40 loc) · 1.14 KB
/
asyncTaskChain.I
File metadata and controls
43 lines (40 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file asyncTaskChain.I
* @author drose
* @date 2006-08-23
*/
/**
* Returns true if the thread(s) have been started and are ready to service
* requests, false otherwise. If this is false, the next call to add() or
* add_and_do() will automatically start the threads.
*/
INLINE bool AsyncTaskChain::
is_started() const {
return (_state == S_started);
}
/**
* Returns the time at which the next sleeping thread will awaken, or -1 if
* there are no sleeping threads. Assumes the lock is already held.
*/
INLINE double AsyncTaskChain::
do_get_next_wake_time() const {
if (!_sleeping.empty()) {
return _sleeping.front()->_wake_time;
}
return -1.0;
}
/**
* Returns the time at which the indicated thread will awaken. Assumes the
* lock is already held.
*/
INLINE double AsyncTaskChain::
get_wake_time(AsyncTask *task) {
return task->_wake_time;
}