mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
task chains
This commit is contained in:
parent
bf86abd1c5
commit
7cd09665ac
@ -41,6 +41,7 @@ Loader::
|
|||||||
Loader(const string &name, int num_threads) :
|
Loader(const string &name, int num_threads) :
|
||||||
AsyncTaskManager(name)
|
AsyncTaskManager(name)
|
||||||
{
|
{
|
||||||
|
PT(AsyncTaskChain) chain = make_task_chain("");
|
||||||
if (num_threads < 0) {
|
if (num_threads < 0) {
|
||||||
// -1 means the default number of threads.
|
// -1 means the default number of threads.
|
||||||
|
|
||||||
@ -55,9 +56,9 @@ Loader(const string &name, int num_threads) :
|
|||||||
"you have many CPU's available, to allow loading multiple models "
|
"you have many CPU's available, to allow loading multiple models "
|
||||||
"simultaneously."));
|
"simultaneously."));
|
||||||
|
|
||||||
set_num_threads(loader_num_threads);
|
chain->set_num_threads(loader_num_threads);
|
||||||
} else {
|
} else {
|
||||||
set_num_threads(num_threads);
|
chain->set_num_threads(num_threads);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +87,9 @@ void Loader::
|
|||||||
output(ostream &out) const {
|
output(ostream &out) const {
|
||||||
out << get_type() << " " << get_name();
|
out << get_type() << " " << get_name();
|
||||||
|
|
||||||
if (!_threads.empty()) {
|
int num_tasks = get_num_tasks();
|
||||||
out << " (" << get_num_tasks() << " models pending)";
|
if (num_tasks != 0) {
|
||||||
|
out << " (" << num_tasks << " models pending)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user