Panda3D
panda
src
pipeline
config_pipeline.cxx
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 config_pipeline.cxx
10
* @author drose
11
* @date 2006-03-28
12
*/
13
14
#include "
config_pipeline.h
"
15
#include "
cycleData.h
"
16
#include "
mainThread.h
"
17
#include "
externalThread.h
"
18
#include "
genericThread.h
"
19
#include "
thread.h
"
20
#include "
pandaSystem.h
"
21
22
#include "
dconfig.h
"
23
24
#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_PIPELINE)
25
#error Buildsystem error: BUILDING_PANDA_PIPELINE not defined
26
#endif
27
28
ConfigureDef(config_pipeline);
29
NotifyCategoryDef(pipeline,
""
);
30
NotifyCategoryDef(thread,
""
);
31
32
ConfigureFn(config_pipeline) {
33
init_libpipeline
();
34
}
35
36
ConfigVariableBool
support_threads
37
(
"support-threads"
,
true
,
38
PRC_DESC(
"Set this false to disallow the creation of threads using Panda's "
39
"Thread interface, even if threading support is compiled in. This "
40
"does not affect the operation of mutexes and other synchronization "
41
"primitives, just the creation of threads."
));
42
43
ConfigVariableBool
name_deleted_mutexes
44
(
"name-deleted-mutexes"
,
false
,
45
PRC_DESC(
"Set this true to allocate a name to each Mutex object that "
46
"destructs, so if the Mutex is locked after destruction, we can "
47
"print out its name to aid debugging. This is only available "
48
"when compiled with DEBUG_THREADS. Enabling this variable will "
49
"cause a memory leak, so you should only enable it when you are "
50
"specifically tracking down an operation on a deleted Mutex. "
51
"It is not guaranteed to work, of course, because the memory "
52
"for a deleted Mutex may become reused for some other purpose."
));
53
54
ConfigVariableInt
thread_stack_size
55
(
"thread-stack-size"
, 4194304,
56
PRC_DESC(
"Specifies the minimum size, in bytes, of the stack that will be "
57
"created for each newly-created thread. Not all thread "
58
"implementations respect this value."
));
59
60
/**
61
* Initializes the library. This must be called at least once before any of
62
* the functions or classes in this library can be used. Normally it will be
63
* called by the static initializers and need not be called explicitly, but
64
* special cases exist.
65
*/
66
void
67
init_libpipeline
() {
68
static
bool
initialized =
false
;
69
if
(initialized) {
70
return
;
71
}
72
initialized =
true
;
73
74
#ifdef DO_PIPELINING
75
CycleData::init_type();
76
#endif
77
78
MainThread::init_type();
79
ExternalThread::init_type();
80
GenericThread::init_type();
81
Thread::init_type();
82
83
#ifdef HAVE_THREADS
84
{
85
PandaSystem
*ps =
PandaSystem::get_global_ptr
();
86
ps->
add_system
(
"threads"
);
87
}
88
#endif // HAVE_THREADS
89
}
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition:
configVariableBool.h:23
mainThread.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PandaSystem::get_global_ptr
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
Definition:
pandaSystem.cxx:442
init_libpipeline
void init_libpipeline()
Initializes the library.
Definition:
config_pipeline.cxx:67
PandaSystem
This class is used as a namespace to group several global properties of Panda.
Definition:
pandaSystem.h:26
cycleData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PandaSystem::add_system
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
Definition:
pandaSystem.cxx:365
pandaSystem.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
externalThread.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
genericThread.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
config_pipeline.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableInt
This is a convenience class to specialize ConfigVariable as an integer type.
Definition:
configVariableInt.h:24
thread.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Sun Dec 27 2020 13:23:14 for Panda3D by
1.8.20