diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-01-02 14:31:48 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-01-02 14:31:48 +0000 |
| commit | 4ca6dd275393344b9a27cfb2e5a755a4d74a414f (patch) | |
| tree | 18c8ff764744d643c4835dfb14b1f3123be649a8 /lib/base/ebase.cpp | |
| parent | bfa525d0451df77a28db6ce21ec45f00b89661a8 (diff) | |
| download | enigma2-4ca6dd275393344b9a27cfb2e5a755a4d74a414f.tar.gz enigma2-4ca6dd275393344b9a27cfb2e5a755a4d74a414f.zip | |
add support for python threads (python threads are just running when the mainloop
is idle)
add ePythonMessagePump class for interthread communication
Diffstat (limited to 'lib/base/ebase.cpp')
| -rw-r--r-- | lib/base/ebase.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index f40bf39e..491ca093 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -200,8 +200,16 @@ int eMainloop::processOneEvent(unsigned int user_timeout, PyObject **res, ePyObj pfd[i++].events = PyInt_AsLong(val); } } - - ret = ::poll(pfd, fdcount, poll_timeout); + + if (this == eApp) + { + Py_BEGIN_ALLOW_THREADS + ret = ::poll(pfd, fdcount, poll_timeout); + Py_END_ALLOW_THREADS + } + else + ret = ::poll(pfd, fdcount, poll_timeout); + /* ret > 0 means that there are some active poll entries. */ if (ret > 0) { |
