diff options
-rw-r--r-- | .cproject | 158 | ||||
-rw-r--r-- | .gitattributes | 42 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .project | 27 | ||||
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | include/CommonAPI/Runtime.hpp | 1 | ||||
-rw-r--r-- | src/CommonAPI/Runtime.cpp | 28 |
7 files changed, 28 insertions, 233 deletions
diff --git a/.cproject b/.cproject deleted file mode 100644 index 30aab95..0000000 --- a/.cproject +++ /dev/null @@ -1,158 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="cdt.managedbuild.config.gnu.so.debug.2004816766"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.so.debug.2004816766" moduleId="org.eclipse.cdt.core.settings" name="Debug"> - <externalSettings> - <externalSetting> - <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CommonAPI"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CommonAPI/Debug"/> - <entry flags="RESOLVED" kind="libraryFile" name="CommonAPI" srcPrefixMapping="" srcRootPath=""/> - </externalSetting> - </externalSettings> - <extensions> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.so.debug.2004816766" name="Debug" parent="cdt.managedbuild.config.gnu.so.debug"> - <folderInfo id="cdt.managedbuild.config.gnu.so.debug.2004816766." name="/" resourcePath=""> - <toolChain id="cdt.managedbuild.toolchain.gnu.so.debug.497381271" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.so.debug"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.so.debug.1370267250" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.so.debug"/> - <builder arguments="-C ${ProjDirPath}/build" buildPath="" command="make" id="cdt.managedbuild.target.gnu.builder.so.debug.519407999" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.so.debug"/> - <tool id="cdt.managedbuild.tool.gnu.archiver.base.1925371138" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> - <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1270137030" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug"> - <option id="gnu.cpp.compiler.so.debug.option.optimization.level.1684435105" name="Optimization Level" superClass="gnu.cpp.compiler.so.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> - <option id="gnu.cpp.compiler.so.debug.option.debugging.level.1146943018" name="Debug Level" superClass="gnu.cpp.compiler.so.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> - <option id="gnu.cpp.compiler.option.include.paths.1636146351" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths"/> - <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2137374827" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.1730014309" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug"> - <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.so.debug.option.optimization.level.2106113516" name="Optimization Level" superClass="gnu.c.compiler.so.debug.option.optimization.level" valueType="enumerated"/> - <option id="gnu.c.compiler.so.debug.option.debugging.level.438248361" name="Debug Level" superClass="gnu.c.compiler.so.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> - <option id="gnu.c.compiler.option.include.paths.1749492263" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/> - <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.902470379" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.c.linker.so.debug.703198397" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.debug"> - <option defaultValue="true" id="gnu.c.link.so.debug.option.shared.831754320" name="Shared (-shared)" superClass="gnu.c.link.so.debug.option.shared" valueType="boolean"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.847083839" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug"> - <option defaultValue="true" id="gnu.cpp.link.so.debug.option.shared.629193581" name="Shared (-shared)" superClass="gnu.cpp.link.so.debug.option.shared" valueType="boolean"/> - <option id="gnu.cpp.link.option.paths.2015212926" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/> - <option id="gnu.cpp.link.option.libs.1584502257" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/> - <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.61199527" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> - <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> - <additionalInput kind="additionalinput" paths="$(LIBS)"/> - </inputType> - </tool> - <tool id="cdt.managedbuild.tool.gnu.assembler.so.debug.55718477" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.debug"> - <option id="gnu.both.asm.option.include.paths.633248275" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1589853807" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - </toolChain> - </folderInfo> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="cdt.managedbuild.config.gnu.so.release.784058498"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.so.release.784058498" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <externalSettings> - <externalSetting> - <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CommonAPI"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CommonAPI/Release"/> - <entry flags="RESOLVED" kind="libraryFile" name="CommonAPI" srcPrefixMapping="" srcRootPath=""/> - </externalSetting> - </externalSettings> - <extensions> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.so.release.784058498" name="Release" parent="cdt.managedbuild.config.gnu.so.release"> - <folderInfo id="cdt.managedbuild.config.gnu.so.release.784058498." name="/" resourcePath=""> - <toolChain id="cdt.managedbuild.toolchain.gnu.so.release.1704197754" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.so.release"> - <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.so.release.1724952823" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.so.release"/> - <builder buildPath="${workspace_loc:/ascgit017.CommonAPI}/Release" id="cdt.managedbuild.target.gnu.builder.so.release.525957098" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.so.release"/> - <tool id="cdt.managedbuild.tool.gnu.archiver.base.1707794608" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> - <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1110361147" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.release"> - <option id="gnu.cpp.compiler.so.release.option.optimization.level.1280823978" name="Optimization Level" superClass="gnu.cpp.compiler.so.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> - <option id="gnu.cpp.compiler.so.release.option.debugging.level.4407501" name="Debug Level" superClass="gnu.cpp.compiler.so.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> - <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.953820603" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.c.compiler.so.release.523128546" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.release"> - <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.so.release.option.optimization.level.1500245439" name="Optimization Level" superClass="gnu.c.compiler.so.release.option.optimization.level" valueType="enumerated"/> - <option id="gnu.c.compiler.so.release.option.debugging.level.1054034731" name="Debug Level" superClass="gnu.c.compiler.so.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> - <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1634087900" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.c.linker.so.release.1726119538" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.release"> - <option defaultValue="true" id="gnu.c.link.so.release.option.shared.1850583711" name="Shared (-shared)" superClass="gnu.c.link.so.release.option.shared" valueType="boolean"/> - </tool> - <tool id="cdt.managedbuild.tool.gnu.cpp.linker.so.release.1470862717" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.release"> - <option defaultValue="true" id="gnu.cpp.link.so.release.option.shared.1097520032" name="Shared (-shared)" superClass="gnu.cpp.link.so.release.option.shared" valueType="boolean"/> - <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1001678157" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> - <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> - <additionalInput kind="additionalinput" paths="$(LIBS)"/> - </inputType> - </tool> - <tool id="cdt.managedbuild.tool.gnu.assembler.so.release.910811714" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.release"> - <inputType id="cdt.managedbuild.tool.gnu.assembler.input.975507970" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> - </tool> - </toolChain> - </folderInfo> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="ascgit017.CommonAPI.cdt.managedbuild.target.gnu.so.1931182818" name="Shared Library" projectType="cdt.managedbuild.target.gnu.so"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.release.784058498;cdt.managedbuild.config.gnu.so.release.784058498.;cdt.managedbuild.tool.gnu.c.compiler.so.release.523128546;cdt.managedbuild.tool.gnu.c.compiler.input.1634087900"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.release.784058498;cdt.managedbuild.config.gnu.so.release.784058498.;cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1110361147;cdt.managedbuild.tool.gnu.cpp.compiler.input.953820603"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.debug.2004816766;cdt.managedbuild.config.gnu.so.debug.2004816766.;cdt.managedbuild.tool.gnu.c.compiler.so.debug.1730014309;cdt.managedbuild.tool.gnu.c.compiler.input.902470379"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.debug.2004816766;cdt.managedbuild.config.gnu.so.debug.2004816766.;cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1270137030;cdt.managedbuild.tool.gnu.cpp.compiler.input.2137374827"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - </scannerConfigBuildInfo> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> - <storageModule moduleId="refreshScope" versionNumber="2"> - <configuration configurationName="Release"> - <resource resourceType="PROJECT" workspacePath="/CommonAPI"/> - </configuration> - <configuration configurationName="Debug"> - <resource resourceType="PROJECT" workspacePath="/CommonAPI"/> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"> - <buildTargets> - <target name="Run cmake" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> - <buildCommand>cmake</buildCommand> - <buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=debug ../</buildArguments> - <buildTarget/> - <stopOnError>true</stopOnError> - <useDefaultCommand>false</useDefaultCommand> - <runAllBuilders>true</runAllBuilders> - </target> - </buildTargets> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> -</cproject> diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 3e11ece..0000000 --- a/.gitattributes +++ /dev/null @@ -1,42 +0,0 @@ -# set default behaviour, in case users don't have core.autocrlf set. -* text=auto - -# Explicitly declare text files we want to always be normalized and converted -# to native line endings on checkout. -*.am text -*.ac text -*.m4 text -*.in text - -*.c text -*.cpp text -*.h text -*.hpp text - -*.fidl text -*.java text -*.xtend text - -*.html text -*.xml text - -*.properties text - -AUTHORS text -LICENSE text -README text - -# Eclipse -.autotools text -.cproject text -.project text -org.eclipse.core.resources.prefs text -*.MF text - -# Declare files that will always have CRLF line endings on checkout. -*.sln binary -*.vcxproj binary - -# Denote all files that are truly binary and should not be modified. -*.png binary -*.jpg binary diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 65f8040..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build/* -.settings/* diff --git a/.project b/.project deleted file mode 100644 index 98d09b1..0000000 --- a/.project +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>CommonAPI</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - </natures> -</projectDescription> @@ -1,5 +1,8 @@ Changes ======= +v3.1.12.2 +- Defer Runtime destruction till shared object is unloaded + v3.1.12.1 - replaced std::chrono::high_resolution_clock by std::chrono::steady_clock in MainLoopContext.cpp diff --git a/include/CommonAPI/Runtime.hpp b/include/CommonAPI/Runtime.hpp index 169e039..afd9fa0 100644 --- a/include/CommonAPI/Runtime.hpp +++ b/include/CommonAPI/Runtime.hpp @@ -188,7 +188,6 @@ private: bool isInitialized_; static std::map<std::string, std::string> properties_; - static std::shared_ptr<Runtime> theRuntime__; friend class ProxyManager; }; diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp index b9124cd..c8176aa 100644 --- a/src/CommonAPI/Runtime.cpp +++ b/src/CommonAPI/Runtime.cpp @@ -27,7 +27,19 @@ const char *COMMONAPI_DEFAULT_CONFIG_FILE = "commonapi.ini"; const char *COMMONAPI_DEFAULT_CONFIG_FOLDER = "/etc"; std::map<std::string, std::string> properties__; -std::shared_ptr<Runtime> Runtime::theRuntime__ = std::make_shared<Runtime>(); +static std::shared_ptr<Runtime> * theRuntimePtr__; +static std::mutex getMutex__; + +#ifndef _WIN32 +DEINITIALIZER(RuntimeDeinit) { + if (theRuntimePtr__) { + std::lock_guard<std::mutex> itsLock(getMutex__); + theRuntimePtr__->reset(); + delete theRuntimePtr__; + theRuntimePtr__ = nullptr; + } +} +#endif std::string Runtime::getProperty(const std::string &_name) { @@ -43,8 +55,18 @@ Runtime::setProperty(const std::string &_name, const std::string &_value) { } std::shared_ptr<Runtime> Runtime::get() { - theRuntime__->init(); - return theRuntime__; + std::lock_guard<std::mutex> itsLock(getMutex__); + if(!theRuntimePtr__) { + theRuntimePtr__ = new std::shared_ptr<Runtime>(); + } + if (theRuntimePtr__) { + if (!*theRuntimePtr__) { + *theRuntimePtr__ = std::make_shared<Runtime>(); + (*theRuntimePtr__)->init(); + } + return *theRuntimePtr__; + } + return nullptr; } Runtime::Runtime() |