git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't translate "", add FIXME
[enigma2.git]
/
lib
/
gdi
/
grc.cpp
diff --git
a/lib/gdi/grc.cpp
b/lib/gdi/grc.cpp
index d13809530f22b1f663e356ac9e7767e4bdf3bb8a..19a32b62b5c379ea095089c4131ec90b6564c450 100644
(file)
--- a/
lib/gdi/grc.cpp
+++ b/
lib/gdi/grc.cpp
@@
-1,10
+1,4
@@
-// for debugging use:
-// #define SYNC_PAINT
#include <unistd.h>
#include <unistd.h>
-#ifndef SYNC_PAINT
-#include <pthread.h>
-#endif
-
#include <lib/gdi/grc.h>
#include <lib/gdi/font.h>
#include <lib/base/init.h>
#include <lib/gdi/grc.h>
#include <lib/gdi/font.h>
#include <lib/base/init.h>
@@
-63,8
+57,7
@@
void gRC::submit(const gOpcode &o)
#ifndef SYNC_PAINT
pthread_mutex_lock(&mutex);
#endif
#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 )
if ( tmp == MAXSIZE )
tmp=0;
if ( tmp == rp )
@@
-102,23
+95,27
@@
void *gRC::thread()
#ifndef SYNC_PAINT
while (1)
{
#ifndef SYNC_PAINT
while (1)
{
- singleLock s(mutex);
#else
while (rp != wp)
{
#else
while (rp != wp)
{
+#endif
+#ifndef SYNC_PAINT
+ pthread_mutex_lock(&mutex);
#endif
if ( rp != wp )
{
#endif
if ( rp != wp )
{
- gOpcode& o(queue[rp]);
+ gOpcode o(queue[rp++]);
+ if ( rp == MAXSIZE )
+ rp=0;
+#ifndef SYNC_PAINT
+ pthread_mutex_unlock(&mutex);
+#endif
if (o.opcode==gOpcode::shutdown)
break;
else if (o.opcode==gOpcode::notify)
need_notify = 1;
else
o.dc->exec(&o);
if (o.opcode==gOpcode::shutdown)
break;
else if (o.opcode==gOpcode::notify)
need_notify = 1;
else
o.dc->exec(&o);
- rp++;
- if ( rp == MAXSIZE )
- rp=0;
}
else
{
}
else
{
@@
-129,6
+126,7
@@
void *gRC::thread()
}
#ifndef SYNC_PAINT
pthread_cond_wait(&cond, &mutex);
}
#ifndef SYNC_PAINT
pthread_cond_wait(&cond, &mutex);
+ pthread_mutex_unlock(&mutex);
#endif
}
}
#endif
}
}