ThreadingModel used in const member function
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@132 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
30b3c736af
commit
118c72dad1
3 changed files with 12 additions and 12 deletions
|
@ -97,7 +97,7 @@ namespace Loki
|
||||||
template <class Host>
|
template <class Host>
|
||||||
class ObjectLevelLockable
|
class ObjectLevelLockable
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION mtx_;
|
mutable CRITICAL_SECTION mtx_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectLevelLockable()
|
ObjectLevelLockable()
|
||||||
|
@ -115,12 +115,12 @@ namespace Loki
|
||||||
|
|
||||||
class Lock
|
class Lock
|
||||||
{
|
{
|
||||||
ObjectLevelLockable& host_;
|
ObjectLevelLockable const& host_;
|
||||||
|
|
||||||
Lock(const Lock&);
|
Lock(const Lock&);
|
||||||
Lock& operator=(const Lock&);
|
Lock& operator=(const Lock&);
|
||||||
public:
|
public:
|
||||||
Lock(Host& host) : host_(host)
|
Lock(const Host& host) : host_(host)
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&host_.mtx_);
|
::EnterCriticalSection(&host_.mtx_);
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ public:
|
||||||
}
|
}
|
||||||
::EnterCriticalSection(&mtx_);
|
::EnterCriticalSection(&mtx_);
|
||||||
}
|
}
|
||||||
Lock(Host&)
|
Lock(const Host&)
|
||||||
{
|
{
|
||||||
if (!mtx_initialisation_done) {
|
if (!mtx_initialisation_done) {
|
||||||
initialize_impl();
|
initialize_impl();
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace Loki
|
||||||
template <class Host>
|
template <class Host>
|
||||||
class ObjectLevelLockable
|
class ObjectLevelLockable
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION mtx_;
|
mutable CRITICAL_SECTION mtx_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectLevelLockable()
|
ObjectLevelLockable()
|
||||||
|
@ -91,13 +91,13 @@ namespace Loki
|
||||||
|
|
||||||
class Lock
|
class Lock
|
||||||
{
|
{
|
||||||
ObjectLevelLockable& host_;
|
ObjectLevelLockable const& host_;
|
||||||
|
|
||||||
Lock(const Lock&);
|
Lock(const Lock&);
|
||||||
Lock& operator=(const Lock&);
|
Lock& operator=(const Lock&);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit Lock(ObjectLevelLockable& host) : host_(host)
|
explicit Lock(const ObjectLevelLockable& host) : host_(host)
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&host_.mtx_);
|
::EnterCriticalSection(&host_.mtx_);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ namespace Loki
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&initializer_.mtx_);
|
::EnterCriticalSection(&initializer_.mtx_);
|
||||||
}
|
}
|
||||||
explicit Lock(ClassLevelLockable&)
|
explicit Lock(const ClassLevelLockable&)
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&initializer_.mtx_);
|
::EnterCriticalSection(&initializer_.mtx_);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace Loki
|
||||||
template <class Host>
|
template <class Host>
|
||||||
class ObjectLevelLockable
|
class ObjectLevelLockable
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION mtx_;
|
mutable CRITICAL_SECTION mtx_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectLevelLockable()
|
ObjectLevelLockable()
|
||||||
|
@ -91,13 +91,13 @@ namespace Loki
|
||||||
|
|
||||||
class Lock
|
class Lock
|
||||||
{
|
{
|
||||||
ObjectLevelLockable& host_;
|
ObjectLevelLockable const& host_;
|
||||||
|
|
||||||
Lock(const Lock&);
|
Lock(const Lock&);
|
||||||
Lock& operator=(const Lock&);
|
Lock& operator=(const Lock&);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit Lock(ObjectLevelLockable& host) : host_(host)
|
explicit Lock(const ObjectLevelLockable& host) : host_(host)
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&host_.mtx_);
|
::EnterCriticalSection(&host_.mtx_);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ namespace Loki
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&initializer_.mtx_);
|
::EnterCriticalSection(&initializer_.mtx_);
|
||||||
}
|
}
|
||||||
explicit Lock(ClassLevelLockable&)
|
explicit Lock(const ClassLevelLockable&)
|
||||||
{
|
{
|
||||||
::EnterCriticalSection(&initializer_.mtx_);
|
::EnterCriticalSection(&initializer_.mtx_);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue