[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/GC.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/GC.h |
Date: |
Sun, 01 Jul 2007 06:00:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/07/01 06:00:25
Modified files:
. : ChangeLog
libbase : GC.h
Log message:
* libbase/GC.h: assert that only the main thread registers
collectable
objects with the GC, or runs the collector.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3624&r2=1.3625
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/GC.h?cvsroot=gnash&r1=1.9&r2=1.10
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3624
retrieving revision 1.3625
diff -u -b -r1.3624 -r1.3625
--- ChangeLog 30 Jun 2007 18:22:00 -0000 1.3624
+++ ChangeLog 1 Jul 2007 06:00:23 -0000 1.3625
@@ -1,3 +1,8 @@
+2007-07-01 Sandro Santilli <address@hidden>
+
+ * libbase/GC.h: assert that only the main thread registers collectable
+ objects with the GC, or runs the collector.
+
2007-06-30 Sandro Santilli <address@hidden>
* server/impl.cpp (clear): don't exit, try the proper cleanup way;
Index: libbase/GC.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/GC.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libbase/GC.h 20 Jun 2007 14:27:30 -0000 1.9
+++ libbase/GC.h 1 Jul 2007 06:00:24 -0000 1.10
@@ -26,6 +26,10 @@
#include <list>
#include <algorithm> //for std::find
+#ifndef NDEBUG
+# include <boost/thread.hpp>
+#endif
+
// Define the following macro to enable GC verbosity
// Define to > 1 to have info printed about scan of already reachable objects
#define GNASH_GC_DEBUG 1
@@ -211,9 +215,13 @@
///
void addCollectable(const GcResource* item)
{
+#ifndef NDEBUG
+ boost::thread self;
+ assert(self == mainThread);
assert(item);
assert(! item->isReachable());
assert(std::find(_resList.begin(), _resList.end(), item) ==
_resList.end());
+#endif
_resList.push_back(item);
#if GNASH_GC_DEBUG > 1
@@ -232,6 +240,11 @@
log_debug(_("Starting collector: " SIZET_FMT " collectables"),
_resList.size());
#endif // GNASH_GC_DEBUG
+#ifndef NDEBUG
+ boost::thread self;
+ assert(self == mainThread);
+#endif
+
// Mark all resources as reachable
markReachable();
@@ -275,6 +288,13 @@
GcRoot& _root;
static GC* _singleton;
+
+#ifndef NDEBUG
+ /// The thread that initialized the GC is
+ /// the only one allowed to run the collector
+ /// and to register collectable objects
+ boost::thread mainThread;
+#endif
};
- [Gnash-commit] gnash ChangeLog libbase/GC.h,
Sandro Santilli <=