diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-12 12:07:58 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-12 12:07:58 (GMT) |
commit | 7d98ac1fd2e9da3162f3b6d38b22106f463edd9d (patch) | |
tree | 712a8f5400654a88f916438bf6bf86621cab5e67 /src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h | |
parent | c34e0ce034586a05308e552cbbdff48beec7dd96 (diff) | |
download | uscxml-7d98ac1fd2e9da3162f3b6d38b22106f463edd9d.zip uscxml-7d98ac1fd2e9da3162f3b6d38b22106f463edd9d.tar.gz uscxml-7d98ac1fd2e9da3162f3b6d38b22106f463edd9d.tar.bz2 |
Support different threads on prolog datamodel
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 |