summaryrefslogtreecommitdiff
path: root/ace/Filecache.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-02 06:23:09 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-02 06:23:09 +0000
commit5c343e466e3107edbddffb92e7a5f74559754b6c (patch)
tree689409ae3a062b8f19f3ba02838278726003559a /ace/Filecache.cpp
parente89f1c4750067e3ad0844c3d5e9a198731dbe2b7 (diff)
downloadATCD-5c343e466e3107edbddffb92e7a5f74559754b6c.tar.gz
Reverted MP safe Double-checking modification. It doesn't solve the real problem here.
Diffstat (limited to 'ace/Filecache.cpp')
-rw-r--r--ace/Filecache.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp
index 484c41c03c2..5662fc3a3ea 100644
--- a/ace/Filecache.cpp
+++ b/ace/Filecache.cpp
@@ -35,7 +35,6 @@ static const int WRITE_FLAGS = O_RDWR | O_CREAT | O_TRUNC;
// static data members
ACE_Filecache *ACE_Filecache::cvf_ = 0;
-int ACE_Filecache::instantiated_ = 0;
void
ACE_Filecache_Handle::init (void)
@@ -187,7 +186,7 @@ ACE_Filecache *
ACE_Filecache::instance (void)
{
// Double check locking pattern.
- if (ACE_Filecache::instantiated_ == 0)
+ if (ACE_Filecache::cvf_ == 0)
{
ACE_SYNCH_RW_MUTEX &lock =
*ACE_Managed_Object<ACE_SYNCH_RW_MUTEX>::get_preallocated_object
@@ -196,14 +195,8 @@ ACE_Filecache::instance (void)
// @@ James, please check each of the ACE_NEW_RETURN calls to
// make sure that it is safe to return if allocation fails.
- if (ACE_Filecache::instantiated_ == 0)
- {
- ACE_NEW_RETURN (ACE_Filecache::cvf_, ACE_Filecache, 0);
- ACE_Filecache::instantiated_ = -1;
- // @@ There's no cleanup routine for ACE_Filecache singleton
- // at this moment. Don't forget to reset <instantiated_> to
- // 0 after destructing it.
- }
+ if (ACE_Filecache::cvf_ == 0)
+ ACE_NEW_RETURN (ACE_Filecache::cvf_, ACE_Filecache, 0);
}
return ACE_Filecache::cvf_;