Panda3D
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) {
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
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  {
86  ps->add_system("threads");
87  }
88 #endif // HAVE_THREADS
89 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
void init_libpipeline()
Initializes the library.