Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Scott <conrad.scott@dsl.pipex.com>2002-07-02 18:54:27 +0400
committerConrad Scott <conrad.scott@dsl.pipex.com>2002-07-02 18:54:27 +0400
commitcfb44111b09234164d0b792a30373d82ba027e38 (patch)
tree6b75f5886495f112511120a92e334fac8994e69b /winsup/cygwin
parent7607be6221151ab471444db3a898c813c208a761 (diff)
* shm.cc: Remove the use of a static client_shmmgr object.
(client_shmmgr::_instance): New static variable. (client_shmmgr::instance): Allocate a new shmmgr on the heap, rather than using a local static object.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/shm.cc12
2 files changed, 16 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2eaf74b4a..c350d7a8d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-02 Conrad Scott <conrad.scott@dsl.pipex.com>
+
+ * shm.cc: Remove the use of a static client_shmmgr object.
+ (client_shmmgr::_instance): New static variable.
+ (client_shmmgr::instance): Allocate a new shmmgr on the heap,
+ rather than using a local static object.
+
2002-07-02 Egor Duda <deo@logos-m.ru>
* include/cygwin/version.h: Bump API minor version.
diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc
index 75fd04aa9..cb3caa3d0 100644
--- a/winsup/cygwin/shm.cc
+++ b/winsup/cygwin/shm.cc
@@ -105,6 +105,8 @@ public:
int fixup_shms_after_fork ();
private:
+ static NO_COPY client_shmmgr *_instance;
+
CRITICAL_SECTION _segments_lock;
static segment_t *_segments_head; // A list sorted by shmaddr.
@@ -122,7 +124,8 @@ private:
segment_t *new_segment (int shmid, const void *, int shmflg, HANDLE);
};
-client_shmmgr::segment_t *client_shmmgr::_segments_head;
+/* static */ NO_COPY client_shmmgr *client_shmmgr::_instance;
+/* static */ client_shmmgr::segment_t *client_shmmgr::_segments_head;
/*---------------------------------------------------------------------------*
* client_shmmgr::instance ()
@@ -131,9 +134,12 @@ client_shmmgr::segment_t *client_shmmgr::_segments_head;
client_shmmgr &
client_shmmgr::instance ()
{
- static NO_COPY client_shmmgr instance;
+ if (!_instance)
+ _instance = new client_shmmgr;
+
+ assert (_instance);
- return instance;
+ return *_instance;
}
/*---------------------------------------------------------------------------*