diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-09-26 17:34:19 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-09-26 17:34:19 +0000 |
| commit | 73fb21862b1daf86d4dd08d514b31c58122e7c9f (patch) | |
| tree | a82098f9d8f5b0431f52b91e57dc5073370dbfb8 /lib/gdi/grc.cpp | |
| parent | 76e87479554f771723ea4005788f9318cd1654f4 (diff) | |
| download | enigma2-73fb21862b1daf86d4dd08d514b31c58122e7c9f.tar.gz enigma2-73fb21862b1daf86d4dd08d514b31c58122e7c9f.zip | |
- try to optimize notify behaviour: notify only when queue is empty
Diffstat (limited to 'lib/gdi/grc.cpp')
| -rw-r--r-- | lib/gdi/grc.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp index 05aaa6ff..55d266c0 100644 --- a/lib/gdi/grc.cpp +++ b/lib/gdi/grc.cpp @@ -1,5 +1,5 @@ // for debugging use: -#define SYNC_PAINT +// #define SYNC_PAINT #include <unistd.h> #ifndef SYNC_PAINT #include <pthread.h> @@ -55,6 +55,7 @@ gRC::~gRC() void *gRC::thread() { + int need_notify = 0; #ifndef SYNC_PAINT while (1) #else @@ -66,12 +67,17 @@ void *gRC::thread() if (o.opcode==gOpcode::shutdown) break; if (o.opcode==gOpcode::notify) - { - m_notify_pump.send(1); - } else + need_notify = 1; + else o.dc->exec(&o); o.dc->Release(); queue.dequeue(); + + if ((!queue.size()) && need_notify) + { + need_notify = 0; + m_notify_pump.send(1); + } } #ifndef SYNC_PAINT pthread_exit(0); |
