1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00
* fixed advancing between misisons in campaigns
This commit is contained in:
Michał W. Urbańczyk
2013-02-05 20:06:13 +00:00
parent 8ffd482324
commit 17755caa10
6 changed files with 15 additions and 11 deletions

View File

@@ -74,6 +74,7 @@ void processCommand(const std::string &message, CClient *&client);
extern std::queue<SDL_Event> events;
extern boost::mutex eventsM;
boost::recursive_mutex * CPlayerInterface::pim = new boost::recursive_mutex;
CondSh<bool> CPlayerInterface::terminate_cond;
CPlayerInterface * LOCPLINT;
@@ -1539,10 +1540,10 @@ void CPlayerInterface::update()
while(!terminate_cond.get() && !pim->try_lock()) //try acquiring long until it succeeds or we are told to terminate
boost::this_thread::sleep(boost::posix_time::milliseconds(15));
boost::unique_lock<boost::recursive_mutex> un(*pim, boost::adopt_lock); //create lock from already owned mutex
if(terminate_cond.get())
return;
boost::unique_lock<boost::recursive_mutex> un(*pim, boost::adopt_lock); //create lock from already owned mutex
//make sure that gamestate won't change when GUI objects may obtain its parts on event processing or drawing request
boost::shared_lock<boost::shared_mutex> gsLock(cb->getGsMutex());