I have a plugin where I want to prevent the browser from closing as im saving some data that take a unknown random amount of time.
data_ready = false;
data_ready = saveData(); //using a random amount of time as the user has to specify a location
boost::unique_lock<boost::mutex> lock(mut);
while(!data_ready) {
cond.wait(lock);
}
Asking location for saving the data is prompted but crashes immediately after, which im guessing is the lock. How could I make the browser wait for the user to be finished saving data?