aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-03 20:15:25 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-03 20:15:25 +0000
commit3d9a041b1ae9244499a5fd54a62d5c6d755d98b7 (patch)
treee63f4d0031dda2b77d68b163be22bfee6d7efbba /lib
parent820efbc58145e96f8f4329b2b9c1e159a85f561f (diff)
downloadenigma2-3d9a041b1ae9244499a5fd54a62d5c6d755d98b7.tar.gz
enigma2-3d9a041b1ae9244499a5fd54a62d5c6d755d98b7.zip
do unlock thread before send signal
Diffstat (limited to 'lib')
-rw-r--r--lib/gdi/grc.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp
index b8426192..de6761e8 100644
--- a/lib/gdi/grc.cpp
+++ b/lib/gdi/grc.cpp
@@ -63,8 +63,7 @@ void gRC::submit(const gOpcode &o)
#ifndef SYNC_PAINT
pthread_mutex_lock(&mutex);
#endif
- int tmp=wp;
- tmp+=1;
+ int tmp=wp+1;
if ( tmp == MAXSIZE )
tmp=0;
if ( tmp == rp )
@@ -85,10 +84,10 @@ void gRC::submit(const gOpcode &o)
queue[wp++]=o;
if ( wp == MAXSIZE )
wp = 0;
+ pthread_mutex_unlock(&mutex);
if (o.opcode==gOpcode::flush||o.opcode==gOpcode::shutdown||o.opcode==gOpcode::notify)
#ifndef SYNC_PAINT
pthread_cond_signal(&cond); // wakeup gdi thread
- pthread_mutex_unlock(&mutex);
#else
thread(); // paint
#endif
@@ -109,8 +108,7 @@ void *gRC::thread()
pthread_mutex_lock(&mutex);
if ( rp != wp )
{
- gOpcode o(queue[rp]);
- rp++;
+ gOpcode o(queue[rp++]);
if ( rp == MAXSIZE )
rp=0;
pthread_mutex_unlock(&mutex);