| 31 | |
| 32 | |
| 33 | void readerThread(LFQueue<int>* pQueue_p, int pSize, bool pSleep) { |
| 34 | int* val_p; |
| 35 | |
| 36 | for(int i=0; i<pSize ; i++) { |
| 37 | while(! (val_p = pQueue_p->peek()) ); |
| 38 | QVERIFY(val_p); |
| 39 | |
| 40 | QCOMPARE(*val_p, i); |
| 41 | pQueue_p->dequeue(); |
| 42 | |
| 43 | if(pSleep) |
| 44 | QThread::msleep(1); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | |
| 49 | void TestLFQueue::exchange_data() |