Quote Originally Posted by wysota View Post
I guess you didn't try my solution...
yes i do tried solution given by you, but the entire program hangs on clicking "stop thread" button.
Qt Code:
  1. void MainWindowImpl::Stop_Thread()
  2. { flag_stop = true;
  3. freeBytes.release(); //QSemaphore freeBytes;
  4. usedBytes.release(); //QSemaphore usedBytes;
  5. producer->wait();
  6. consumer->wait();
  7. }
To copy to clipboard, switch view to plain text mode 
So can u tel me where i m doing wrong.i wil be greatful beause i am reallly stuck here.