mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Rework CCallback <-> CClient interaction
- callback is now part of lib instead of weird class that is shared by client and AI while being part of client - callback interacts with client class via minimal interface class - removed no longer used unlockGsWhileWaiting field
This commit is contained in:
@@ -90,29 +90,10 @@ namespace vstd
|
||||
return unlock_guard<Mutex, detail::unlock_policy<Mutex> >(m_);
|
||||
}
|
||||
template<typename Mutex>
|
||||
unlock_guard<Mutex, detail::unlock_policy<Mutex> > makeEmptyGuard(Mutex &)
|
||||
{
|
||||
return unlock_guard<Mutex, detail::unlock_policy<Mutex> >();
|
||||
}
|
||||
template<typename Mutex>
|
||||
unlock_guard<Mutex, detail::unlock_policy<Mutex> > makeUnlockGuardIf(Mutex &m_, bool shallUnlock)
|
||||
{
|
||||
return shallUnlock
|
||||
? makeUnlockGuard(m_)
|
||||
: unlock_guard<Mutex, detail::unlock_policy<Mutex> >();
|
||||
}
|
||||
template<typename Mutex>
|
||||
unlock_guard<Mutex, detail::unlock_shared_policy<Mutex> > makeUnlockSharedGuard(Mutex &m_)
|
||||
{
|
||||
return unlock_guard<Mutex, detail::unlock_shared_policy<Mutex> >(m_);
|
||||
}
|
||||
template<typename Mutex>
|
||||
unlock_guard<Mutex, detail::unlock_shared_policy<Mutex> > makeUnlockSharedGuardIf(Mutex &m_, bool shallUnlock)
|
||||
{
|
||||
return shallUnlock
|
||||
? makeUnlockSharedGuard(m_)
|
||||
: unlock_guard<Mutex, detail::unlock_shared_policy<Mutex> >();
|
||||
}
|
||||
|
||||
using unlock_shared_guard = unlock_guard<std::shared_mutex, detail::unlock_shared_policy<std::shared_mutex>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user