Hello guys,

how is possible pause and then resume thread in QT?
My application starts http proxy server in new thread and in some moments I need pause the thread with proxy and get/set data from comunication process between client and server.
I tried this,

Qt Code:
  1. proxy::proxy(sqlitt * sq) {
  2.  
  3. pending = false;
  4. }
  5.  
  6. void proxy::run(){
  7.  
  8. smw = new sslMeatWrapper(this);
  9.  
  10. }
  11.  
  12. // this method is called from sslMeatWrapper when new request arrives
  13. void proxy::proxyRequest() {
  14. qDebug << "Incoming proxy request";
  15. pending = true;
  16. // in this moment I need to pause thread and get/set data from/to smw object
  17. while (pending)
  18. msleep(1000);
  19.  
  20. }
To copy to clipboard, switch view to plain text mode 

In GUI class there is a slot

Qt Code:
  1. void sqlitt::next() {
  2. pr->pending = true;
  3. }
To copy to clipboard, switch view to plain text mode 

but this is not working. The thread is stocked on while statement i suppose. Can you please advice?

Thanks