diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-04-25 11:19:48 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-04-25 11:19:48 -0700 |
commit | 9c81cdb4b04f83ee99c5c4126aa1e7ae93e7cabc (patch) | |
tree | e0de1a32212fec99274d244632902d2fd635f22f /py/modules/IcePy/Util.h | |
parent | Removed bogus sl/chat/bin directory (diff) | |
download | ice-9c81cdb4b04f83ee99c5c4126aa1e7ae93e7cabc.tar.bz2 ice-9c81cdb4b04f83ee99c5c4126aa1e7ae93e7cabc.tar.xz ice-9c81cdb4b04f83ee99c5c4126aa1e7ae93e7cabc.zip |
misc. python cleanup
Diffstat (limited to 'py/modules/IcePy/Util.h')
-rw-r--r-- | py/modules/IcePy/Util.h | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/py/modules/IcePy/Util.h b/py/modules/IcePy/Util.h index 30b9814fcf7..eff5d97f902 100644 --- a/py/modules/IcePy/Util.h +++ b/py/modules/IcePy/Util.h @@ -14,9 +14,6 @@ #include <Ice/BuiltinSequences.h> #include <Ice/Current.h> #include <Ice/Exception.h> -#include <IceUtil/Thread.h> -#include <IceUtil/Monitor.h> -#include <IceUtil/Mutex.h> // // These macros replace Py_RETURN_FALSE and Py_RETURN TRUE. We use these @@ -163,37 +160,6 @@ private: }; // -// Release Python's Global Interpreter Lock during potentially time-consuming -// (and non-Python related) work. -// -class AllowThreads -{ -public: - - AllowThreads(); - ~AllowThreads(); - -private: - - PyThreadState* _state; -}; - -// -// Ensure that the current thread is capable of calling into Python. -// -class AdoptThread -{ -public: - - AdoptThread(); - ~AdoptThread(); - -private: - - PyGILState_STATE _state; -}; - -// // Convert Ice::StringSeq to and from a Python list. // bool listToStringSeq(PyObject*, Ice::StringSeq&); @@ -267,55 +233,6 @@ bool setIdentity(PyObject*, const Ice::Identity&); // bool getIdentity(PyObject*, Ice::Identity&); -// -// This class invokes a member function in a separate thread. -// -template<typename T> -class InvokeThread : public IceUtil::Thread -{ -public: - - InvokeThread(const IceInternal::Handle<T>& target, void (T::*func)(void), - IceUtil::Monitor<IceUtil::Mutex>& monitor, bool& done) : - _target(target), _func(func), _monitor(monitor), _done(done), _ex(0) - { - } - - ~InvokeThread() - { - delete _ex; - } - - virtual void run() - { - try - { - (_target.get() ->* _func)(); - } - catch(const Ice::Exception& ex) - { - _ex = ex.ice_clone(); - } - - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); - _done = true; - _monitor.notify(); - } - - Ice::Exception* getException() const - { - return _ex; - } - -private: - - IceInternal::Handle<T> _target; - void (T::*_func)(void); - IceUtil::Monitor<IceUtil::Mutex>& _monitor; - bool& _done; - Ice::Exception* _ex; -}; - } extern "C" PyObject* IcePy_stringVersion(PyObject*); |