diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h')
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h index 75e2d74..d52dd24 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h @@ -34,6 +34,22 @@ namespace uscxml { class SWIDataModel : public DataModelImpl { public: + class SWIEngineLock { + public: + SWIEngineLock() { + isLocked = false; + int rc = PL_set_engine(PL_ENGINE_MAIN, NULL); + if (rc == PL_ENGINE_SET) { + isLocked = true; + } + } + ~SWIEngineLock() { + if (isLocked) + PL_set_engine(NULL, NULL); + } + bool isLocked; + }; + SWIDataModel(); virtual ~SWIDataModel(); virtual boost::shared_ptr<DataModelImpl> create(InterpreterImpl* interpreter); @@ -106,6 +122,7 @@ protected: std::string _plModule; std::string _name; std::string _sessionId; + PL_engine_t _engine; }; #ifdef BUILD_AS_PLUGINS |