hi wysota,
hi it means,normally if a function take longer time,we use threading to avoid problems,
but in my case i did it, as there are many process at the same time access the function,
we need to lock the function,so one thread can only access...
i have tried with threading ,but when many thread calls that function ,the application
hangs
mutex.lock();
while(status == 1)
{
thisthread
->setPriority
(QThread::LowestPriority);
thisthread->start();
}
thisthread->quit();
mutex.unlock();
mutex.lock();
while(status == 1)
{
thisthread->setPriority(QThread::LowestPriority);
thisthread->start();
}
thisthread->quit();
mutex.unlock();
To copy to clipboard, switch view to plain text mode
This is what i have done...i will change the status=0 in a timer within some seconds(2 sec)
but due to the while loop ,the app gets hanged.and it does not allow the timer to timeout
to change the status=0
So that i am trying to use threading ,and as many process will call this while loop ,so i need a mutex to lock...
pls help me...
thanks
Bookmarks