corrected constructor parameter in ObjectLevelLockable::Lock

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@98 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
humesikkins 2003-02-27 15:50:07 +00:00
parent 3fe3afd55e
commit bbeec4b27c

View file

@ -8,7 +8,7 @@
// affects only default template arguments // affects only default template arguments
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Last update: Dec 03, 2002 // Last update: Feb 20, 2003
// note: In this VC 6 port all template policies become non-templates with // note: In this VC 6 port all template policies become non-templates with
// either member-template functions or a nested template struct named In // either member-template functions or a nested template struct named In
@ -108,14 +108,14 @@ namespace Loki
class Lock class Lock
{ {
ObjectLevelLockable& host_; ObjectLevelLockable::In<Host>& host_;
Lock(const Lock&); Lock(const Lock&);
Lock& operator=(const Lock&); Lock& operator=(const Lock&);
Lock(); // buggy design //Lock(); // buggy design
public: public:
explicit Lock(ObjectLevelLockable& host) : host_(host) explicit Lock(ObjectLevelLockable::In<Host>& host) : host_(host)
{ {
::EnterCriticalSection(&host_.mtx_); ::EnterCriticalSection(&host_.mtx_);
} }
@ -148,9 +148,12 @@ namespace Loki
template <class Host> template <class Host>
struct In struct In
{ {
private: public:
struct Initializer;
friend struct Initializer;
struct Initializer struct Initializer
{ {
CRITICAL_SECTION mtx_; CRITICAL_SECTION mtx_;
Initializer() Initializer()
@ -217,6 +220,7 @@ namespace Loki
// Change log: // Change log:
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!! // June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
// Oct 06, 2002: ported by Benjamin Kaufmann to MSVC 6.0 // Oct 06, 2002: ported by Benjamin Kaufmann to MSVC 6.0
// Feb 20, 2003: corrected constructor parameter in ObjectLevelLockable::Lock
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#endif #endif