#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 )
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
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);