You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2007-05-17 06:05:38
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28217 Modified Files: ChangeLog Log Message: Style sheet fixes. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1502 retrieving revision 1.1503 diff -C2 -d -r1.1502 -r1.1503 *** ChangeLog 15 May 2007 05:46:13 -0000 1.1502 --- ChangeLog 17 May 2007 06:05:32 -0000 1.1503 *************** *** 1,2 **** --- 1,6 ---- + 2007-05-17 Braden McDaniel <br...@en...> + + * doc/doxygen-header: Style sheet fixes. + 2007-05-15 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-17 06:05:38
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28217/doc Modified Files: doxygen-header Log Message: Style sheet fixes. Index: doxygen-header =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/doxygen-header,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** doxygen-header 24 Jul 2006 23:54:06 -0000 1.21 --- doxygen-header 17 May 2007 06:05:33 -0000 1.22 *************** *** 136,141 **** } ! .memItemLeft, .memItemRight, ! .memTemplParams, .memTemplItemLeft, .memTemplItemRight, .memproto, .memproto td { font-family: "Bitstream Vera Sans Mono", --- 136,141 ---- } ! td.memItemLeft, td.memItemRight, ! td.memTemplParams, td.memTemplItemLeft, td.memTemplItemRight, .memproto, .memproto td { font-family: "Bitstream Vera Sans Mono", |
From: Braden M. <br...@us...> - 2007-05-17 06:05:16
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28079 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Style sheet fixes. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.170 retrieving revision 1.1310.2.171 diff -C2 -d -r1.1310.2.170 -r1.1310.2.171 *** ChangeLog 12 May 2007 03:29:18 -0000 1.1310.2.170 --- ChangeLog 17 May 2007 06:05:11 -0000 1.1310.2.171 *************** *** 1,2 **** --- 1,6 ---- + 2007-05-17 Braden McDaniel <br...@en...> + + * doc/doxygen-header: Style sheet fixes. + 2007-05-11 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-17 06:05:16
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28079/doc Modified Files: Tag: OpenVRML-0_16-BRANCH doxygen-header Log Message: Style sheet fixes. Index: doxygen-header =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/doxygen-header,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** doxygen-header 24 Jul 2006 23:54:06 -0000 1.21 --- doxygen-header 17 May 2007 06:05:15 -0000 1.21.2.1 *************** *** 136,141 **** } ! .memItemLeft, .memItemRight, ! .memTemplParams, .memTemplItemLeft, .memTemplItemRight, .memproto, .memproto td { font-family: "Bitstream Vera Sans Mono", --- 136,141 ---- } ! td.memItemLeft, td.memItemRight, ! td.memTemplParams, td.memTemplItemLeft, td.memTemplItemRight, .memproto, .memproto td { font-family: "Bitstream Vera Sans Mono", |
From: Braden M. <br...@us...> - 2007-05-15 05:46:13
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2792/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml Modified Files: openvrml.vcproj Log Message: Added read_write_mutex.{cpp,h} to the project. Index: openvrml.vcproj =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml/openvrml.vcproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** openvrml.vcproj 14 May 2007 21:08:03 -0000 1.13 --- openvrml.vcproj 15 May 2007 05:46:13 -0000 1.14 *************** *** 246,249 **** --- 246,253 ---- </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\read_write_mutex.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\rendering_context.cpp" > *************** *** 410,413 **** --- 414,421 ---- </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\read_write_mutex.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\rendering_context.h" > |
From: Braden M. <br...@us...> - 2007-05-15 05:46:13
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2792 Modified Files: ChangeLog Log Message: Added read_write_mutex.{cpp,h} to the project. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1501 retrieving revision 1.1502 diff -C2 -d -r1.1501 -r1.1502 *** ChangeLog 15 May 2007 04:06:10 -0000 1.1501 --- ChangeLog 15 May 2007 05:46:13 -0000 1.1502 *************** *** 1,4 **** --- 1,9 ---- 2007-05-15 Braden McDaniel <br...@en...> + * ide-projects/Windows/VisualC8_0/OpenVRML/openvrml/openvrml.vcproj: + Added read_write_mutex.{cpp,h} to the project. + + 2007-05-15 Braden McDaniel <br...@en...> + Added a read/write mutex. Hopefully Boost will have a read/write mutex before too long; if/when that happens, this one can probably |
From: Braden M. <br...@us...> - 2007-05-15 04:06:12
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28374/src/openvrml-xembed Modified Files: gtkvrmlbrowser.cpp plugin_streambuf.cpp plugin_streambuf.h Log Message: Added a read/write mutex. Hopefully Boost will have a read/write mutex before too long; if/when that happens, this one can probably go away. openvrml::read_write_mutex simply follows the implementation described by Butenhof using the Boost thread primitives. Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** plugin_streambuf.cpp 12 May 2007 03:29:41 -0000 1.5 --- plugin_streambuf.cpp 15 May 2007 04:06:11 -0000 1.6 *************** *** 142,146 **** find(const std::string & url) const { ! boost::mutex::scoped_lock lock(this->mutex_); map_t::const_iterator pos = this->map_.find(url); return pos == this->map_.end() --- 142,146 ---- find(const std::string & url) const { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); map_t::const_iterator pos = this->map_.find(url); return pos == this->map_.end() *************** *** 154,158 **** const boost::shared_ptr<plugin_streambuf> & streambuf) { ! boost::mutex::scoped_lock lock(this->mutex_); this->map_.insert(make_pair(url, streambuf)); } --- 154,158 ---- const boost::shared_ptr<plugin_streambuf> & streambuf) { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); this->map_.insert(make_pair(url, streambuf)); } *************** *** 171,175 **** erase(const std::string & url) { ! boost::mutex::scoped_lock lock(this->mutex_); const map_t::iterator pos = this->map_.find(url); if (pos == this->map_.end()) { return false; } --- 171,175 ---- erase(const std::string & url) { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); const map_t::iterator pos = this->map_.find(url); if (pos == this->map_.end()) { return false; } *************** *** 180,184 **** size_t openvrml_xembed::uninitialized_plugin_streambuf_map::size() const { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.size(); } --- 180,184 ---- size_t openvrml_xembed::uninitialized_plugin_streambuf_map::size() const { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); return this->map_.size(); } *************** *** 186,190 **** bool openvrml_xembed::uninitialized_plugin_streambuf_map::empty() const { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.empty(); } --- 186,190 ---- bool openvrml_xembed::uninitialized_plugin_streambuf_map::empty() const { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); return this->map_.empty(); } *************** *** 193,197 **** openvrml_xembed::uninitialized_plugin_streambuf_map::front() const { ! boost::mutex::scoped_lock lock(this->mutex_); g_assert(!this->map_.empty()); return this->map_.begin()->second; --- 193,197 ---- openvrml_xembed::uninitialized_plugin_streambuf_map::front() const { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); g_assert(!this->map_.empty()); return this->map_.begin()->second; *************** *** 205,209 **** openvrml_xembed::plugin_streambuf_map::find(const size_t id) const { ! boost::mutex::scoped_lock lock(this->mutex_); map_t::const_iterator pos = this->map_.find(id); return pos == this->map_.end() --- 205,209 ---- openvrml_xembed::plugin_streambuf_map::find(const size_t id) const { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); map_t::const_iterator pos = this->map_.find(id); return pos == this->map_.end() *************** *** 217,221 **** const boost::shared_ptr<plugin_streambuf> & streambuf) { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.insert(make_pair(id, streambuf)).second; } --- 217,221 ---- const boost::shared_ptr<plugin_streambuf> & streambuf) { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); return this->map_.insert(make_pair(id, streambuf)).second; } *************** *** 228,232 **** bool openvrml_xembed::plugin_streambuf_map::erase(const size_t id) { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.erase(id) > 0; } --- 228,232 ---- bool openvrml_xembed::plugin_streambuf_map::erase(const size_t id) { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); return this->map_.erase(id) > 0; } Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/gtkvrmlbrowser.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gtkvrmlbrowser.cpp 27 Apr 2007 03:01:39 -0000 1.8 --- gtkvrmlbrowser.cpp 15 May 2007 04:06:11 -0000 1.9 *************** *** 158,162 **** ::browser_listener browser_listener_; bool browser_initialized_; ! boost::mutex browser_initialized_mutex_; GtkVrmlBrowser & vrml_browser_; guint timer; --- 158,162 ---- ::browser_listener browser_listener_; bool browser_initialized_; ! openvrml::read_write_mutex browser_initialized_mutex_; GtkVrmlBrowser & vrml_browser_; guint timer; *************** *** 212,216 **** { { ! boost::mutex::scoped_lock lock(this->viewer_->browser_initialized_mutex_); this->viewer_->browser_initialized_ = false; --- 212,216 ---- { { ! openvrml::read_write_mutex::scoped_write_lock lock(this->viewer_->browser_initialized_mutex_); this->viewer_->browser_initialized_ = false; *************** *** 246,250 **** GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); { ! boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); viewer.browser_initialized_ = false; } --- 246,251 ---- GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); { ! openvrml::read_write_mutex::scoped_write_lock ! lock(viewer.browser_initialized_mutex_); viewer.browser_initialized_ = false; } *************** *** 348,353 **** GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); ! if (!viewer.browser_initialized_) { return true; } if (event->count == 0 --- 349,357 ---- GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! { ! openvrml::read_write_mutex::scoped_read_lock ! lock(viewer.browser_initialized_mutex_); ! if (!viewer.browser_initialized_) { return true; } ! } if (event->count == 0 *************** *** 540,544 **** GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! boost::mutex::scoped_lock lock(viewer.browser_initialized_mutex_); if (!viewer.browser_initialized_) { return true; } viewer.input(&info); --- 544,549 ---- GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); ! openvrml::read_write_mutex::scoped_read_lock ! lock(viewer.browser_initialized_mutex_); if (!viewer.browser_initialized_) { return true; } viewer.input(&info); *************** *** 677,683 **** { if (event.id() == openvrml::browser_event::initialized) { ! using boost::mutex; ! mutex::scoped_lock lock(this->viewer_.browser_initialized_mutex_); ! this->viewer_.browser_initialized_ = true; gdk_threads_enter(); scope_guard gdk_threads_guard = make_guard(gdk_threads_leave); --- 682,690 ---- { if (event.id() == openvrml::browser_event::initialized) { ! { ! openvrml::read_write_mutex::scoped_write_lock ! lock(this->viewer_.browser_initialized_mutex_); ! this->viewer_.browser_initialized_ = true; ! } gdk_threads_enter(); scope_guard gdk_threads_guard = make_guard(gdk_threads_leave); Index: plugin_streambuf.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plugin_streambuf.h 12 May 2007 03:29:41 -0000 1.4 --- plugin_streambuf.h 15 May 2007 04:06:11 -0000 1.5 *************** *** 28,31 **** --- 28,32 ---- # include <boost/shared_ptr.hpp> # include <boost/enable_shared_from_this.hpp> + # include <openvrml/read_write_mutex.h> # include "bounded_buffer.h" *************** *** 68,72 **** extern class uninitialized_plugin_streambuf_map : boost::noncopyable { ! mutable boost::mutex mutex_; typedef std::multimap<std::string, boost::shared_ptr<plugin_streambuf> > map_t; --- 69,73 ---- extern class uninitialized_plugin_streambuf_map : boost::noncopyable { ! mutable openvrml::read_write_mutex mutex_; typedef std::multimap<std::string, boost::shared_ptr<plugin_streambuf> > map_t; *************** *** 85,89 **** extern class plugin_streambuf_map : boost::noncopyable { ! mutable boost::mutex mutex_; typedef std::map<size_t, boost::shared_ptr<plugin_streambuf> > map_t; map_t map_; --- 86,90 ---- extern class plugin_streambuf_map : boost::noncopyable { ! mutable openvrml::read_write_mutex mutex_; typedef std::map<size_t, boost::shared_ptr<plugin_streambuf> > map_t; map_t map_; |
From: Braden M. <br...@us...> - 2007-05-15 04:06:12
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28374/src/libopenvrml/openvrml Modified Files: browser.cpp browser.h field_value.h Added Files: read_write_mutex.cpp read_write_mutex.h Log Message: Added a read/write mutex. Hopefully Boost will have a read/write mutex before too long; if/when that happens, this one can probably go away. openvrml::read_write_mutex simply follows the implementation described by Butenhof using the Boost thread primitives. --- NEW FILE: read_write_mutex.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // // OpenVRML // // Copyright 2007 Braden McDaniel // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # ifdef HAVE_CONFIG_H # include <config.h> # endif #include "read_write_mutex.h" /** * @class openvrml::read_write_mutex openvrml/read_write_mutex.h * * @brief A read/write mutex with an interface that follows the * patterns established in the Boost thread library. * * This read/write mutex is implemented in terms of @c boost::mutex * and @c boost::condition. */ /** * @internal * * @var boost::mutex openvrml::read_write_mutex::mutex_ * * @brief The underlying mutex. */ /** * @internal * * @var boost::condition openvrml::read_write_mutex::read_ * * @brief When writing is done, this condition is signaled to indicate * that readers can acquire the lock. */ /** * @internal * * @var boost::condition openvrml::read_write_mutex::write_ * * @brief When reading is done, this condition is signaled to indicate * that a writer can acquire the lock. */ /** * @internal * * @var size_t openvrml::read_write_mutex::readers_active_ * * @brief The number of readers currently sharing the lock. */ /** * @internal * * @var size_t openvrml::read_write_mutex::readers_waiting_ * * @brief The number of readers currently waiting for the lock. */ /** * @internal * * @var size_t openvrml::read_write_mutex::writers_waiting_ * * @brief The number of writers currently waiting for the lock. */ /** * @internal * * @var bool openvrml::read_write_mutex::writing_ * * @brief @c true if a writer has the lock; @c false otherwise. */ /** * @class openvrml::read_write_mutex::scoped_read_lock openvrml/read_write_lock.h * * @brief Lock the mutex for read access. */ /** * @internal * * @var openvrml::read_write_mutex & openvrml::read_write_mutex::scoped_read_lock::mutex_ * * @brief The @c read_write_mutex being locked. */ /** * @internal * * @var boost::mutex::scoped_lock openvrml::read_write_mutex::scoped_read_lock::lock_ * * @brief A lock for @c read_write_mutex::mutex_. */ /** * @brief Construct. * * Acquire the lock. * * @param[in] mutex a @c read_write_mutex. */ openvrml::read_write_mutex::scoped_read_lock:: scoped_read_lock(read_write_mutex & mutex): mutex_(mutex), lock_(mutex.mutex_) { if (this->mutex_.writing_) { ++this->mutex_.readers_waiting_; while (this->mutex_.writing_) { this->mutex_.read_.wait(this->lock_); } --this->mutex_.readers_waiting_; } ++this->mutex_.readers_active_; this->lock_.unlock(); } /** * @brief Destroy. * * Release the lock. */ openvrml::read_write_mutex::scoped_read_lock::~scoped_read_lock() { this->lock_.lock(); --this->mutex_.readers_active_; if (this->mutex_.readers_active_ == 0 && this->mutex_.writers_waiting_ != 0) { this->mutex_.write_.notify_one(); } } /** * @class openvrml::read_write_mutex::scoped_write_lock openvrml/read_write_lock.h * * @brief Lock the mutex for write access. */ /** * @internal * * @var openvrml::read_write_mutex & openvrml::read_write_mutex::scoped_write_lock::mutex_ * * @brief The @c read_write_mutex being locked. */ /** * @internal * * @var boost::mutex::scoped_lock openvrml::read_write_mutex::scoped_write_lock::lock_ * * @brief A lock for @c read_write_mutex::mutex_. */ /** * @brief Construct. * * Acquire the lock. * * @param[in] mutex a @c read_write_mutex. */ openvrml::read_write_mutex::scoped_write_lock:: scoped_write_lock(read_write_mutex & mutex): mutex_(mutex), lock_(mutex.mutex_) { if (this->mutex_.writing_ || this->mutex_.readers_active_ != 0) { ++this->mutex_.writers_waiting_; while (this->mutex_.writing_ || this->mutex_.readers_active_ != 0) { this->mutex_.write_.wait(this->lock_); } --this->mutex_.writers_waiting_; } this->mutex_.writing_ = true; this->lock_.unlock(); } /** * @brief Destroy. * * Release the lock. */ openvrml::read_write_mutex::scoped_write_lock::~scoped_write_lock() { this->lock_.lock(); this->mutex_.writing_ = false; if (this->mutex_.readers_waiting_ != 0) { this->mutex_.read_.notify_all(); } else if (this->mutex_.writers_waiting_ != 0) { this->mutex_.write_.notify_one(); } } /** * @brief Construct. */ openvrml::read_write_mutex::read_write_mutex(): readers_active_(0), readers_waiting_(0), writers_waiting_(0), writing_(false) {} Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** browser.cpp 15 May 2007 02:45:08 -0000 1.212 --- browser.cpp 15 May 2007 04:06:11 -0000 1.213 *************** *** 5082,5086 **** /** ! * @var boost::mutex openvrml::browser::node_metatype_map::mutex_ * * @brief Object mutex. --- 5082,5086 ---- /** ! * @var openvrml::read_write_mutex openvrml::browser::node_metatype_map::mutex_ * * @brief Object mutex. *************** *** 5163,5167 **** openvrml::browser::node_metatype_map::operator=(const node_metatype_map & ncm) { ! boost::mutex::scoped_lock my_lock(this->mutex_), map_lock(ncm.mutex_); map_t temp(ncm.map_); swap(this->map_, temp); --- 5163,5168 ---- openvrml::browser::node_metatype_map::operator=(const node_metatype_map & ncm) { ! read_write_mutex::scoped_write_lock my_lock(this->mutex_); ! read_write_mutex::scoped_read_lock map_lock(ncm.mutex_); map_t temp(ncm.map_); swap(this->map_, temp); *************** *** 5207,5211 **** const double timestamp) { ! boost::mutex::scoped_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), init_node_metatype(initial_viewpoint, timestamp)); --- 5208,5212 ---- const double timestamp) { ! read_write_mutex::scoped_read_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), init_node_metatype(initial_viewpoint, timestamp)); *************** *** 5229,5233 **** const boost::shared_ptr<openvrml::node_metatype> & node_metatype) { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.insert(make_pair(id, node_metatype)).first->second; } --- 5230,5234 ---- const boost::shared_ptr<openvrml::node_metatype> & node_metatype) { ! read_write_mutex::scoped_write_lock lock(this->mutex_); return this->map_.insert(make_pair(id, node_metatype)).first->second; } *************** *** 5242,5246 **** bool openvrml::browser::node_metatype_map::remove(const std::string & id) { ! boost::mutex::scoped_lock lock(this->mutex_); return this->map_.erase(id) > 0; } --- 5243,5247 ---- bool openvrml::browser::node_metatype_map::remove(const std::string & id) { ! read_write_mutex::scoped_write_lock lock(this->mutex_); return this->map_.erase(id) > 0; } *************** *** 5257,5260 **** --- 5258,5262 ---- openvrml::browser::node_metatype_map::find(const std::string & id) const { + read_write_mutex::scoped_read_lock lock(this->mutex_); const map_t::const_iterator pos = this->map_.find(id); return (pos != this->map_.end()) *************** *** 5275,5278 **** --- 5277,5281 ---- OPENVRML_THROW1(std::bad_alloc) { + read_write_mutex::scoped_read_lock lock(this->mutex_); std::vector<node_metatype_id> ids; for (map_t::const_iterator entry = this->map_.begin(); *************** *** 5311,5315 **** void openvrml::browser::node_metatype_map::render(openvrml::viewer & v) { ! boost::mutex::scoped_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), render_node_metatype(v)); } --- 5314,5318 ---- void openvrml::browser::node_metatype_map::render(openvrml::viewer & v) { ! read_write_mutex::scoped_read_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), render_node_metatype(v)); } *************** *** 5342,5346 **** OPENVRML_NOTHROW { ! boost::mutex::scoped_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), shutdown_node_metatype(timestamp)); --- 5345,5349 ---- OPENVRML_NOTHROW { ! read_write_mutex::scoped_read_lock lock(this->mutex_); for_each(this->map_.begin(), this->map_.end(), shutdown_node_metatype(timestamp)); *************** *** 5487,5490 **** --- 5490,5501 ---- * @internal * + * @var boost::mutex openvrml::browser::listeners_mutex_ + * + * @brief Mutex to guard @c #listeners_. + */ + + /** + * @internal + * * @var std::set<openvrml::browser_listener *> openvrml::browser::listeners_ * *************** *** 5492,5497 **** * @c browser_event%s. * ! * @sa openvrml::browser::add_listener ! * @sa openvrml::browser::remove_listener */ --- 5503,5508 ---- * @c browser_event%s. * ! * @sa #add_listener ! * @sa #remove_listener */ *************** *** 5503,5507 **** /** ! * @var boost::mutex openvrml::browser::modified_mutex_ * * @brief Mutex protecting @c #modified_. --- 5514,5518 ---- /** ! * @var openvrml::read_write_mutex openvrml::browser::modified_mutex_ * * @brief Mutex protecting @c #modified_. *************** *** 5996,6073 **** void openvrml::browser::set_world(resource_istream & in) { ! boost::recursive_mutex::scoped_lock lock(this->mutex_); ! using std::for_each; ! using std::string; ! // ! // Clear out the current scene. ! // ! this->load_proto_thread_group_.join_all(); ! double now = browser::current_time(); ! if (this->scene_) { this->scene_->shutdown(now); } ! this->node_metatype_map_.shutdown(now); ! for_each(this->listeners_.begin(), this->listeners_.end(), ! boost::bind2nd(boost::mem_fun(&browser_listener::browser_changed), ! browser_event(*this, browser_event::shutdown))); ! this->scene_.reset(); ! this->active_viewpoint_ = ! node_cast<viewpoint_node *>(this->default_viewpoint_.get()); ! assert(this->viewpoint_list.empty()); ! assert(this->scoped_lights.empty()); ! assert(this->scripts.empty()); ! assert(this->timers.empty()); ! // ! // Create the new scene. ! // ! node_metatype_map new_map; ! this->node_metatype_map_ = new_map; ! register_node_metatypes(*this); ! this->scene_.reset(new scene(*this)); ! this->scene_->load(in); ! // ! // Initialize. ! // ! now = browser::current_time(); ! this->scene_->initialize(now); ! // ! // Get the initial viewpoint_node, if any was specified. ! // ! viewpoint_node * initial_viewpoint = 0; ! const string viewpoint_node_id = uri(this->scene_->url()).fragment(); ! if (!viewpoint_node_id.empty()) { ! if (!this->scene_->nodes().empty()) { ! using boost::intrusive_ptr; ! const intrusive_ptr<node> & n = this->scene_->nodes().front(); ! if (n) { ! node * const vp = n->scope().find_node(viewpoint_node_id); ! initial_viewpoint = dynamic_cast<viewpoint_node *>(vp); } } - } ! // ! // Initialize the node_metatypes. ! // ! this->node_metatype_map_.init(initial_viewpoint, now); ! if (this->active_viewpoint_ ! != node_cast<viewpoint_node *>(this->default_viewpoint_.get())) { ! // XXX ! // XXX Fix openvrml::viewpoint_node so that we don't have to get an ! // XXX event_listener here. ! // XXX ! event_listener & listener = ! this->active_viewpoint_->event_listener("set_bind"); ! dynamic_cast<sfbool_listener &>(listener).process_event(sfbool(true), ! now); ! } ! this->modified(true); ! this->new_view = true; // Force resetUserNav for_each(this->listeners_.begin(), this->listeners_.end(), boost::bind2nd(boost::mem_fun(&browser_listener::browser_changed), --- 6007,6091 ---- void openvrml::browser::set_world(resource_istream & in) { ! { ! boost::recursive_mutex::scoped_lock lock(this->mutex_); ! using std::for_each; ! using std::string; ! // ! // Clear out the current scene. ! // ! this->load_proto_thread_group_.join_all(); ! double now = browser::current_time(); ! if (this->scene_) { this->scene_->shutdown(now); } ! this->node_metatype_map_.shutdown(now); ! read_write_mutex::scoped_read_lock ! listeners_lock(this->listeners_mutex_); ! for_each(this->listeners_.begin(), this->listeners_.end(), ! boost::bind2nd( ! boost::mem_fun(&browser_listener::browser_changed), ! browser_event(*this, browser_event::shutdown))); ! this->scene_.reset(); ! this->active_viewpoint_ = ! node_cast<viewpoint_node *>(this->default_viewpoint_.get()); ! assert(this->viewpoint_list.empty()); ! assert(this->scoped_lights.empty()); ! assert(this->scripts.empty()); ! assert(this->timers.empty()); ! // ! // Create the new scene. ! // ! node_metatype_map new_map; ! this->node_metatype_map_ = new_map; ! register_node_metatypes(*this); ! this->scene_.reset(new scene(*this)); ! this->scene_->load(in); ! // ! // Initialize. ! // ! now = browser::current_time(); ! this->scene_->initialize(now); ! // ! // Get the initial viewpoint_node, if any was specified. ! // ! viewpoint_node * initial_viewpoint = 0; ! const string viewpoint_node_id = uri(this->scene_->url()).fragment(); ! if (!viewpoint_node_id.empty()) { ! if (!this->scene_->nodes().empty()) { ! using boost::intrusive_ptr; ! const intrusive_ptr<node> & n = this->scene_->nodes().front(); ! if (n) { ! node * const vp = n->scope().find_node(viewpoint_node_id); ! initial_viewpoint = dynamic_cast<viewpoint_node *>(vp); ! } } } ! // ! // Initialize the node_metatypes. ! // ! this->node_metatype_map_.init(initial_viewpoint, now); ! if (this->active_viewpoint_ ! != node_cast<viewpoint_node *>(this->default_viewpoint_.get())) { ! // XXX ! // XXX Fix openvrml::viewpoint_node so that we don't have to get an ! // XXX event_listener here. ! // XXX ! event_listener & listener = ! this->active_viewpoint_->event_listener("set_bind"); ! dynamic_cast<sfbool_listener &>(listener) ! .process_event(sfbool(true), now); ! } ! this->modified(true); ! this->new_view = true; // Force resetUserNav ! } // unlock this->mutex_, this->listeners_mutex_ + read_write_mutex::scoped_read_lock + listeners_lock(this->listeners_mutex_); for_each(this->listeners_.begin(), this->listeners_.end(), boost::bind2nd(boost::mem_fun(&browser_listener::browser_changed), *************** *** 6112,6115 **** --- 6130,6134 ---- try { + boost::recursive_mutex::scoped_lock lock(browser.mutex_); std::auto_ptr<resource_istream> in = browser.scene_->get_resource(this->url_); *************** *** 6278,6281 **** --- 6297,6301 ---- OPENVRML_THROW1(std::bad_alloc) { + read_write_mutex::scoped_write_lock lock(this->listeners_mutex_); return this->listeners_.insert(&listener).second; } *************** *** 6293,6296 **** --- 6313,6317 ---- OPENVRML_NOTHROW { + read_write_mutex::scoped_write_lock lock(this->listeners_mutex_); return this->listeners_.erase(&listener) > 0; } *************** *** 6477,6481 **** void openvrml::browser::modified(const bool value) { ! boost::mutex::scoped_lock lock(this->modified_mutex_); this->modified_ = value; } --- 6498,6502 ---- void openvrml::browser::modified(const bool value) { ! read_write_mutex::scoped_write_lock lock(this->modified_mutex_); this->modified_ = value; } *************** *** 6488,6492 **** bool openvrml::browser::modified() const { ! boost::mutex::scoped_lock lock(this->modified_mutex_); return this->modified_; } --- 6509,6513 ---- bool openvrml::browser::modified() const { ! read_write_mutex::scoped_read_lock lock(this->modified_mutex_); return this->modified_; } *************** *** 6793,6797 **** * @internal * ! * @var boost::recursive_mutex openvrml::scene::nodes_mutex_ * * @brief Mutex protecting @a nodes_. --- 6814,6818 ---- * @internal * ! * @var openvrml::read_write_mutex openvrml::scene::nodes_mutex_ * * @brief Mutex protecting @a nodes_. *************** *** 6809,6813 **** * @internal * ! * @var boost::read_write_mutex openvrml::scene::url_mutex_ * * @brief Mutex protecting @a url_. --- 6830,6834 ---- * @internal * ! * @var openvrml::read_write_mutex openvrml::scene::url_mutex_ * * @brief Mutex protecting @a url_. *************** *** 6827,6831 **** * @internal * ! * @var boost::mutex openvrml::scene::meta_mutex_ * * @brief Mutex protecting @c #meta_. --- 6848,6852 ---- * @internal * ! * @var openvrml::read_write_mutex openvrml::scene::meta_mutex_ * * @brief Mutex protecting @c #meta_. *************** *** 6893,6898 **** void openvrml::scene::load(resource_istream & in) { ! boost::recursive_mutex::scoped_lock nodes_lock(this->nodes_mutex_); ! boost::mutex::scoped_lock url_lock(this->url_mutex_), meta_lock(this->meta_mutex_); --- 6914,6919 ---- void openvrml::scene::load(resource_istream & in) { ! read_write_mutex::scoped_write_lock ! nodes_lock(this->nodes_mutex_), url_lock(this->url_mutex_), meta_lock(this->meta_mutex_); *************** *** 6915,6919 **** OPENVRML_THROW1(std::bad_alloc) { ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator node( this->nodes_.begin()); --- 6936,6940 ---- OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_read_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator node( this->nodes_.begin()); *************** *** 6942,6946 **** OPENVRML_THROW2(std::invalid_argument, std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->meta_mutex_); using std::map; --- 6963,6967 ---- OPENVRML_THROW2(std::invalid_argument, std::bad_alloc) { ! read_write_mutex::scoped_read_lock lock(this->meta_mutex_); using std::map; *************** *** 6966,6970 **** OPENVRML_THROW1(std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->meta_mutex_); this->meta_[key] = value; } --- 6987,6991 ---- OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_write_lock lock(this->meta_mutex_); this->meta_[key] = value; } *************** *** 6978,6982 **** OPENVRML_THROW1(std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->meta_mutex_); using std::map; --- 6999,7003 ---- OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_read_lock lock(this->meta_mutex_); using std::map; *************** *** 7003,7007 **** openvrml::scene::nodes() const OPENVRML_THROW1(std::bad_alloc) { ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); return this->nodes_; } --- 7024,7028 ---- openvrml::scene::nodes() const OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_read_lock lock(this->nodes_mutex_); return this->nodes_; } *************** *** 7033,7037 **** check_uninitialized.traverse(n); ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); const double now = browser::current_time(); this->shutdown(now); --- 7054,7058 ---- check_uninitialized.traverse(n); ! read_write_mutex::scoped_write_lock lock(this->nodes_mutex_); const double now = browser::current_time(); this->shutdown(now); *************** *** 7047,7051 **** OPENVRML_NOTHROW { ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); return this->nodes_.empty() ? 0 --- 7068,7072 ---- OPENVRML_NOTHROW { ! read_write_mutex::scoped_read_lock lock(this->nodes_mutex_); return this->nodes_.empty() ? 0 *************** *** 7062,7066 **** const std::string openvrml::scene::url() const OPENVRML_THROW1(std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->url_mutex_); using std::string; const string result = (this->parent_ && !this->url_.empty()) --- 7083,7087 ---- const std::string openvrml::scene::url() const OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_read_lock lock(this->url_mutex_); using std::string; const string result = (this->parent_ && !this->url_.empty()) *************** *** 7080,7084 **** rendering_context context) { ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator n( this->nodes_.begin()); --- 7101,7105 ---- rendering_context context) { ! read_write_mutex::scoped_read_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator n( this->nodes_.begin()); *************** *** 7349,7353 **** void openvrml::scene::shutdown(const double timestamp) OPENVRML_NOTHROW { ! boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator n( this->nodes_.begin()); --- 7370,7374 ---- void openvrml::scene::shutdown(const double timestamp) OPENVRML_NOTHROW { ! read_write_mutex::scoped_read_lock lock(this->nodes_mutex_); for (std::vector<boost::intrusive_ptr<node> >::iterator n( this->nodes_.begin()); Index: browser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** browser.h 15 May 2007 02:45:09 -0000 1.66 --- browser.h 15 May 2007 04:06:11 -0000 1.67 *************** *** 25,28 **** --- 25,29 ---- # include <boost/thread.hpp> + # include <openvrml/read_write_mutex.h> # include <openvrml/script.h> *************** *** 189,193 **** class OPENVRML_LOCAL node_metatype_map { ! mutable boost::mutex mutex_; typedef std::map<std::string, boost::shared_ptr<node_metatype> > map_t; --- 190,194 ---- class OPENVRML_LOCAL node_metatype_map { ! mutable read_write_mutex mutex_; typedef std::map<std::string, boost::shared_ptr<node_metatype> > map_t; *************** *** 243,247 **** --- 244,251 ---- std::list<script_node *> scripts; std::list<time_dependent_node *> timers; + + read_write_mutex listeners_mutex_; std::set<browser_listener *> listeners_; + bool new_view; double delta_time; *************** *** 249,253 **** bool modified_; ! mutable boost::mutex modified_mutex_; resource_fetcher & fetcher_; --- 253,257 ---- bool modified_; ! mutable read_write_mutex modified_mutex_; resource_fetcher & fetcher_; *************** *** 363,373 **** scene * const parent_; ! mutable boost::recursive_mutex nodes_mutex_; std::vector<boost::intrusive_ptr<node> > nodes_; ! mutable boost::mutex url_mutex_; std::string url_; ! mutable boost::mutex meta_mutex_; std::map<std::string, std::string> meta_; --- 367,377 ---- scene * const parent_; ! mutable read_write_mutex nodes_mutex_; std::vector<boost::intrusive_ptr<node> > nodes_; ! mutable read_write_mutex url_mutex_; std::string url_; ! mutable read_write_mutex meta_mutex_; std::map<std::string, std::string> meta_; --- NEW FILE: read_write_mutex.h --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // // OpenVRML // // Copyright 2007 Braden McDaniel // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # ifndef OPENVRML_READ_WRITE_MUTEX_H # define OPENVRML_READ_WRITE_MUTEX_H # include <openvrml-common.h> # include <boost/thread/mutex.hpp> # include <boost/thread/condition.hpp> namespace openvrml { class read_write_mutex : boost::noncopyable { boost::mutex mutex_; boost::condition read_, write_; size_t readers_active_, readers_waiting_, writers_waiting_; bool writing_; public: class scoped_read_lock : boost::noncopyable { read_write_mutex & mutex_; boost::mutex::scoped_lock lock_; public: explicit scoped_read_lock(read_write_mutex & mutex); ~scoped_read_lock(); }; class scoped_write_lock : boost::noncopyable { read_write_mutex & mutex_; boost::mutex::scoped_lock lock_; public: explicit scoped_write_lock(read_write_mutex & mutex); ~scoped_write_lock(); }; read_write_mutex(); }; } # endif // OPENVRML_READ_WRITE_MUTEX_H Index: field_value.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/field_value.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** field_value.h 25 Jul 2006 03:52:07 -0000 1.22 --- field_value.h 15 May 2007 04:06:11 -0000 1.23 *************** *** 34,37 **** --- 34,38 ---- # include <boost/thread/mutex.hpp> # include <openvrml/basetypes.h> + # include <openvrml/read_write_mutex.h> namespace openvrml { *************** *** 60,64 **** template <typename ValueType> class counted_impl : public counted_impl_base { ! mutable boost::mutex mutex_; boost::shared_ptr<ValueType> value_; --- 61,65 ---- template <typename ValueType> class counted_impl : public counted_impl_base { ! mutable read_write_mutex mutex_; boost::shared_ptr<ValueType> value_; *************** *** 176,180 **** counted_impl_base() { ! boost::mutex::scoped_lock lock(ci.mutex_); value_ = ci.value_; } --- 177,181 ---- counted_impl_base() { ! read_write_mutex::scoped_read_lock lock(ci.mutex_); value_ = ci.value_; } *************** *** 188,192 **** OPENVRML_NOTHROW { ! boost::mutex::scoped_lock lock(this->mutex_); assert(this->value_); return *this->value_; --- 189,193 ---- OPENVRML_NOTHROW { ! read_write_mutex::scoped_read_lock lock(this->mutex_); assert(this->value_); return *this->value_; *************** *** 197,201 **** OPENVRML_THROW1(std::bad_alloc) { ! boost::mutex::scoped_lock lock(this->mutex_); assert(this->value_); if (!this->value_.unique()) { --- 198,202 ---- OPENVRML_THROW1(std::bad_alloc) { ! read_write_mutex::scoped_write_lock lock(this->mutex_); assert(this->value_); if (!this->value_.unique()) { |
From: Braden M. <br...@us...> - 2007-05-15 04:06:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28374 Modified Files: ChangeLog Log Message: Added a read/write mutex. Hopefully Boost will have a read/write mutex before too long; if/when that happens, this one can probably go away. openvrml::read_write_mutex simply follows the implementation described by Butenhof using the Boost thread primitives. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1500 retrieving revision 1.1501 diff -C2 -d -r1.1500 -r1.1501 *** ChangeLog 15 May 2007 02:45:08 -0000 1.1500 --- ChangeLog 15 May 2007 04:06:10 -0000 1.1501 *************** *** 1,2 **** --- 1,116 ---- + 2007-05-15 Braden McDaniel <br...@en...> + + Added a read/write mutex. Hopefully Boost will have a read/write + mutex before too long; if/when that happens, this one can probably + go away. openvrml::read_write_mutex simply follows the + implementation described by Butenhof using the Boost thread + primitives. + + * src/libopenvrml/Makefile.am + (openvrml_include_HEADERS): Added openvrml/read_write_mutex.h. + (libopenvrml_la_SOURCES): Added openvrml/read_write_mutex.cpp. + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::node_metatype_map::operator=(const + node_metatype_map &)): Use read and write locks. + (openvrml::browser::node_metatype_map::init(viewpoint_node *, + double)): Use a read lock. + (openvrml::browser::node_metatype_map::insert(const std::string &, + const boost::shared_ptr<openvrml::node_metatype> &)): Use a write + lock. + (openvrml::browser::node_metatype_map::remove(const + std::string&)): Use a write lock. + (openvrml::browser::node_metatype_map::find(const std::string &) + const): Use a read lock. + (openvrml::browser::node_metatype_map::node_metatype_ids(const + openvrml::node_metatype &) const): Use a read lock. + (openvrml::browser::node_metatype_map::render(openvrml::viewer&)): + Use a read lock. + (openvrml::browser::node_metatype_map::shutdown(double)): Use a + read lock. + (openvrml::browser::set_world(resource_istream &)): Only grab the + browser-wide mutex for as long as necessary. This needs more + attention; but this change is a start. + (openvrml::browser::root_scene_loader::operator()() const): Grab + the browser-wide recursive mutex. + (openvrml::browser::add_listener(browser_listener &)): Acquire a + write lock of the listeners_mutex_. + (openvrml::browser::remove_listener(browser_listener &)): Acquire + a write lock of the listeners_mutex_. + (openvrml::browser::modified(bool)): Acquire a write lock of the + modified_mutex_. + (openvrml::browser::modified()): Acquire a read lock of the + modified_mutex_. + (openvrml::scene::load(resource_istream &)): Acquire write locks. + (openvrml::scene::initialize(double)): Acquire a read lock. + (openvrml::scene::meta(const std::string &, const std::string &)): + Aquire a write lock. + (openvrml::scene::meta_keys() const): Acquire a read lock. + (openvrml::scene::nodes() const): Acquire a read lock. + (openvrml::scene::nodes(const + std::vector<boost::intrusive_ptr<node> > &)): Acquire a write + lock. + (openvrml::scene::root_scope() const): Acquire a read lock. + (openvrml::scene::url() const): Acquire a read lock. + (openvrml::scene::render(openvrml::viewer &, rendering_context)): + Aquire a read lock. + (openvrml::scene::shutdown(double)): Aquire a read lock. + * src/libopenvrml/openvrml/browser.h + (openvrml::browser::node_metatype_map): Changed mutex_ to be a + read_write_mutex. + (openvrml::browser): Added member listeners_mutex_ to protect + listeners_. + (openvrml::scene): Changed nodes_mutex_, url_mutex_, and + meta_mutex_ to be read_write_mutexes. + * src/libopenvrml/openvrml/read_write_mutex.cpp + (openvrml::read_write_mutex::scoped_read_lock::scoped_read_lock(read_write_mutex&)): + Acquire a lock for reading. + (openvrml::read_write_mutex::scoped_read_lock::~scoped_read_lock()): + Release a read lock. + (openvrml::read_write_mutex::scoped_write_lock::scoped_write_lock(read_write_mutex&)): + Acquire a lock for writing. + (openvrml::read_write_mutex::scoped_write_lock::~scoped_write_lock()): + Release a write lock. + (openvrml::read_write_mutex::read_write_mutex()): Construct a + read/write mutex. + * src/libopenvrml/openvrml/read_write_mutex.h + (openvrml::read_write_mutex): Added class. + * src/openvrml-xembed/gtkvrmlbrowser.cpp + (GtkGLViewer): Changed browser_initialized_mutex_ to an + openvrml::read_write_mutex. + (GtkGLViewer::load_url::operator()() const): Acquire a write lock. + (gtk_vrml_browser_set_world(GtkVrmlBrowser *, + openvrml::resource_istream &)): Acquire a write lock. + (gtk_vrml_browser_expose_event(GtkWidget *, GdkEventExpose *, + gpointer)): Acquire a read lock. + (gtk_vrml_browser_motion_notify_event(GtkWidget *, + GdkEventMotion*, gpointer)): Acquire a read lock. + (browser_listener::do_browser_changed(const + openvrml::browser_event &)): Acquire a write lock. + * src/openvrml-xembed/plugin_streambuf.cpp + (openvrml_xembed::uninitialized_plugin_streambuf_map::find(const + std::string &) const): Acquire a read lock. + (openvrml_xembed::uninitialized_plugin_streambuf_map::insert(const + std::string &, const boost::shared_ptr<plugin_streambuf> &)): + Acquire a write lock. + (openvrml_xembed::uninitialized_plugin_streambuf_map::erase(const + std::string &)): Acquire a write lock. + (openvrml_xembed::uninitialized_plugin_streambuf_map::size() + const): Acquire a read lock. + (openvrml_xembed::uninitialized_plugin_streambuf_map::empty() + const): Acquire a read lock. + (openvrml_xembed::uninitialized_plugin_streambuf_map::front() + const): Acquire a read lock. + (openvrml_xembed::plugin_streambuf_map::find(size_t) const): + Acquire a read lock. + (openvrml_xembed::plugin_streambuf_map::insert(size_t, const + boost::shared_ptr<plugin_streambuf> &)): Acquire a write lock. + (openvrml_xembed::plugin_streambuf_map::erase(size_t)): Acquire a + write lock. + * src/openvrml-xembed/plugin_streambuf.h + (openvrml_xembed::uninitialized_plugin_streambuf_map): Changed + mutex_ to an openvrml::read_write_mutex. + (openvrml_xembed::plugin_streambuf_map): Changed mutex_ to an + openvrml::read_write_mutex. + 2007-05-14 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-15 04:06:11
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28374/src/libopenvrml Modified Files: Makefile.am Log Message: Added a read/write mutex. Hopefully Boost will have a read/write mutex before too long; if/when that happens, this one can probably go away. openvrml::read_write_mutex simply follows the implementation described by Butenhof using the Boost thread primitives. Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/Makefile.am,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Makefile.am 30 Apr 2007 07:37:25 -0000 1.41 --- Makefile.am 15 May 2007 04:06:11 -0000 1.42 *************** *** 6,9 **** --- 6,10 ---- openvrml_includedir = $(pkgincludedir)/openvrml openvrml_include_HEADERS = \ + openvrml/read_write_mutex.h \ openvrml/basetypes.h \ openvrml/field_value.h \ *************** *** 92,95 **** --- 93,97 ---- libopenvrml_la_SOURCES = \ + openvrml/read_write_mutex.cpp \ openvrml/basetypes.cpp \ openvrml/field_value.cpp \ |
From: Braden M. <br...@us...> - 2007-05-15 02:46:08
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28350 Modified Files: ChangeLog Log Message: Moved implementation of create_vrml_from_url to openvrml::scene. This allows the spawned thread to be a member of the scene::stream_reader_threads_ thread group; and it means that relative URLs in Script nodes in inline worlds should now resolve properly. browser::create_vrml_from_url now simply delegates to scene::create_vrml_from_url on the root scene. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1499 retrieving revision 1.1500 diff -C2 -d -r1.1499 -r1.1500 *** ChangeLog 14 May 2007 21:08:01 -0000 1.1499 --- ChangeLog 15 May 2007 02:45:08 -0000 1.1500 *************** *** 1,4 **** --- 1,35 ---- 2007-05-14 Braden McDaniel <br...@en...> + Moved implementation of create_vrml_from_url to openvrml::scene. + This allows the spawned thread to be a member of the + scene::stream_reader_threads_ thread group; and it means that + relative URLs in Script nodes in inline worlds should now resolve + properly. browser::create_vrml_from_url now simply delegates to + scene::create_vrml_from_url on the root scene. + + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::vrml_from_url_creator): Moved to + openvrml::scene::vrml_from_url_creator. + (openvrml::browser::create_vrml_from_url(const + std::vector<std::string> &, const boost::intrusive_ptr<node> &, + const std::string &)): Delegate to + openvrml::scene::create_vrml_from_url. + (openvrml::scene::vrml_from_url_creator): Moved from + openvrml::browser::vrml_from_url_creator. + (openvrml::scene::create_vrml_from_url(const + std::vector<std::string> &, const boost::intrusive_ptr<node> &, + const std::string &)): Create the thread as a member of the + stream_reader_threads_ group. + * src/libopenvrml/openvrml/browser.h + (openvrml::browser): Removed vrml_from_url_creator declaration. + (openvrml::scene): Added vrml_from_url_creator declaration; added + create_vrml_from_url member function. + * src/libopenvrml/openvrml/script.cpp + (js_::Browser::createVrmlFromURL(JSContext *, JSObject *, uintN, + jsval *, jsval *)): Call openvrml::scene::create_vrml_from_url + rather than openvrml::browser::create_vrml_from_url. + + 2007-05-14 Braden McDaniel <br...@en...> + Visual C++ 8.0 project file updates. |
From: Braden M. <br...@us...> - 2007-05-15 02:46:07
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28350/src/libopenvrml/openvrml Modified Files: browser.cpp browser.h script.cpp Log Message: Moved implementation of create_vrml_from_url to openvrml::scene. This allows the spawned thread to be a member of the scene::stream_reader_threads_ thread group; and it means that relative URLs in Script nodes in inline worlds should now resolve properly. browser::create_vrml_from_url now simply delegates to scene::create_vrml_from_url on the root scene. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** browser.cpp 13 May 2007 06:47:28 -0000 1.211 --- browser.cpp 15 May 2007 02:45:08 -0000 1.212 *************** *** 6236,6286 **** } - struct OPENVRML_LOCAL openvrml::browser::vrml_from_url_creator { - vrml_from_url_creator(openvrml::browser & browser, - const std::vector<std::string> & url, - const boost::intrusive_ptr<node> & node, - const std::string & event) - OPENVRML_THROW2(unsupported_interface, std::bad_cast): - browser_(&browser), - url_(&url), - node_(node), - listener_(&dynamic_cast<mfnode_listener &>( - node->event_listener(event))) - {} - - void operator()() const OPENVRML_NOTHROW - { - try { - try { - std::auto_ptr<resource_istream> in = - this->browser_->scene_->get_resource(*this->url_); - if (!(*in)) { throw unreachable_url(); } - mfnode nodes; - nodes.value( - this->browser_->create_vrml_from_stream(*in, in->type())); - this->listener_->process_event(nodes, browser::current_time()); - } catch (std::exception & ex) { - this->browser_->err(ex.what()); - throw unreachable_url(); - } catch (...) { - // - // The implementation of resource_istream is provided by the - // user; and unfortunately, operations on it could throw - // anything. - // - throw unreachable_url(); - } - } catch (std::exception & ex) { - this->browser_->err(ex.what()); - } - } - - private: - openvrml::browser * const browser_; - const std::vector<std::string> * const url_; - const boost::intrusive_ptr<node> node_; - mfnode_listener * const listener_; - }; - /** * @brief Create nodes from a URI. --- 6236,6239 ---- *************** *** 6307,6312 **** boost::thread_resource_error) { ! boost::function0<void> f = vrml_from_url_creator(*this, url, node, event); ! boost::thread t(f); } --- 6260,6265 ---- boost::thread_resource_error) { ! assert(this->scene_); ! this->scene_->create_vrml_from_url(url, node, event); } *************** *** 7191,7194 **** --- 7144,7223 ---- } + struct OPENVRML_LOCAL openvrml::scene::vrml_from_url_creator { + vrml_from_url_creator(openvrml::scene & scene, + const std::vector<std::string> & url, + const boost::intrusive_ptr<node> & node, + const std::string & event) + OPENVRML_THROW2(unsupported_interface, std::bad_cast): + scene_(&scene), + url_(&url), + node_(node), + listener_(&dynamic_cast<mfnode_listener &>( + node->event_listener(event))) + {} + + void operator()() const OPENVRML_NOTHROW + { + try { + try { + std::auto_ptr<resource_istream> in = + this->scene_->get_resource(*this->url_); + if (!(*in)) { throw unreachable_url(); } + mfnode nodes; + nodes.value( + this->scene_->browser() + .create_vrml_from_stream(*in, in->type())); + this->listener_->process_event(nodes, browser::current_time()); + } catch (std::exception & ex) { + this->scene_->browser().err(ex.what()); + throw unreachable_url(); + } catch (...) { + // + // The implementation of resource_istream is provided by the + // user; and unfortunately, operations on it could throw + // anything. + // + throw unreachable_url(); + } + } catch (std::exception & ex) { + this->scene_->browser().err(ex.what()); + } + } + + private: + openvrml::scene * const scene_; + const std::vector<std::string> * const url_; + const boost::intrusive_ptr<node> node_; + mfnode_listener * const listener_; + }; + + /** + * @brief Create nodes from a URI. + * + * This function executes asynchronously. When the nodes have been completely + * loaded, they are sent to the @p event MFNode eventIn of @p node. + * + * @param[in] url an alternative URI list. + * @param[in] node the node to which the nodes loaded from @p url should be + * sent as an event. + * @param[in] event the event of @p node to which the new nodes will be sent. + * + * @exception unsupported_interface if @p node has no eventIn @p event. + * @exception std::bad_cast if the @p event eventIn of @p node + * is not an MFNode. + * @exception boost::thread_resource_error if thread creation fails. + */ + void + openvrml::scene:: + create_vrml_from_url(const std::vector<std::string> & url, + const boost::intrusive_ptr<node> & node, + const std::string & event) + OPENVRML_THROW3(unsupported_interface, std::bad_cast, + boost::thread_resource_error) + { + boost::function0<void> f = vrml_from_url_creator(*this, url, node, event); + this->stream_reader_threads_.create_thread(f); + } + /** * @brief Load a resource into @a browser. Index: browser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.h,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** browser.h 13 May 2007 06:47:28 -0000 1.65 --- browser.h 15 May 2007 02:45:09 -0000 1.66 *************** *** 187,191 **** struct root_scene_loader; - struct vrml_from_url_creator; class OPENVRML_LOCAL node_metatype_map { --- 187,190 ---- *************** *** 359,362 **** --- 358,363 ---- class OPENVRML_API scene : boost::noncopyable { + struct vrml_from_url_creator; + openvrml::browser * const browser_; scene * const parent_; *************** *** 403,406 **** --- 404,412 ---- void read_stream(std::auto_ptr<resource_istream> in, std::auto_ptr<stream_listener> listener); + void create_vrml_from_url(const std::vector<std::string> & url, + const boost::intrusive_ptr<node> & node, + const std::string & event) + OPENVRML_THROW3(unsupported_interface, std::bad_cast, + boost::thread_resource_error); void shutdown(double timestamp) OPENVRML_NOTHROW; Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** script.cpp 18 Apr 2007 03:58:15 -0000 1.81 --- script.cpp 15 May 2007 02:45:09 -0000 1.82 *************** *** 4445,4452 **** try { ! script.script_node().openvrml::node::type().metatype().browser() ! .create_vrml_from_url(url->value(), ! node->value(), ! event ? event : ""); } catch (const std::bad_cast & ex) { JS_ReportError(cx, "%s is not of type MFNode", event); --- 4445,4452 ---- try { ! script.script_node().scene() ! ->create_vrml_from_url(url->value(), ! node->value(), ! event ? event : ""); } catch (const std::bad_cast & ex) { JS_ReportError(cx, "%s is not of type MFNode", event); |
From: Braden M. <br...@us...> - 2007-05-14 21:08:48
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351 Modified Files: ChangeLog Log Message: Visual C++ 8.0 project file updates. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1498 retrieving revision 1.1499 diff -C2 -d -r1.1498 -r1.1499 *** ChangeLog 13 May 2007 06:47:26 -0000 1.1498 --- ChangeLog 14 May 2007 21:08:01 -0000 1.1499 *************** *** 1,2 **** --- 1,28 ---- + 2007-05-14 Braden McDaniel <br...@en...> + + Visual C++ 8.0 project file updates. + + * ide-projects/Windows/VisualC8_0/OpenVRML/OpenVRML.sln: Removed + sdl-viewer dependency on antlr. openvrml's dependency on antlr + should be sufficient. + * ide-projects/Windows/VisualC8_0/OpenVRML/antlr/antlr.vcproj: + Added TokenRefCount.{cpp,hpp} to the project. Define + NO_STATIC_CONSTS; otherwise, static const integers defined in the + class definition confuse the linker. + * ide-projects/Windows/VisualC8_0/OpenVRML/openvrml/openvrml.vcproj: + Define NO_STATIC_CONSTS for antlr. Added gdi32.lib, advapi32.lib, + shell32.lib as additional dependencies--Visual C++ Express seems + to need these, though the professional version does not. Upgraded + FreeType dependency to version 2.3.4. Made "Whole Program + Optimization" a project default for the Release configuration. + Ignore default libraries libcmtd.lib and libcmt.lib for Debug and + Release configurations, respectively; boost_thread is probably + pulling these in. + * ide-projects/Windows/VisualC8_0/OpenVRML/openvrml-gl/openvrml-gl.vcproj: + Made "Whole Program Optimization" a project default for the + Release configuration. + * ide-projects/Windows/VisualC8_0/OpenVRML/sdl-viewer/sdl-viewer.vcproj: + Ignore msvcrt.lib in the Debug configuration; SDL pulls this in. + 2007-05-13 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-14 21:08:04
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/sdl-viewer In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351/ide-projects/Windows/VisualC8_0/OpenVRML/sdl-viewer Modified Files: sdl-viewer.vcproj Log Message: Visual C++ 8.0 project file updates. Index: sdl-viewer.vcproj =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/sdl-viewer/sdl-viewer.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sdl-viewer.vcproj 26 Sep 2006 15:42:51 -0000 1.6 --- sdl-viewer.vcproj 14 May 2007 21:08:04 -0000 1.7 *************** *** 69,72 **** --- 69,73 ---- OutputFile="$(SolutionDir)..\bin\sdl-viewerd.exe" LinkIncremental="2" + IgnoreDefaultLibraryNames="msvcrt.lib" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/sdl-viewer.pdb" |
From: Braden M. <br...@us...> - 2007-05-14 21:08:04
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml-gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml-gl Modified Files: openvrml-gl.vcproj Log Message: Visual C++ 8.0 project file updates. Index: openvrml-gl.vcproj =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml-gl/openvrml-gl.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** openvrml-gl.vcproj 26 Sep 2006 15:42:51 -0000 1.7 --- openvrml-gl.vcproj 14 May 2007 21:08:03 -0000 1.8 *************** *** 103,106 **** --- 103,107 ---- ConfigurationType="2" CharacterSet="2" + WholeProgramOptimization="1" > <Tool *************** *** 124,128 **** InlineFunctionExpansion="1" OmitFramePointers="true" - WholeProgramOptimization="true" AdditionalIncludeDirectories=""..\..\..\..\..\src\libopenvrml-gl";..\..\..\..\..\src\libopenvrml;..\openvrml;." PreprocessorDefinitions="WIN32;NDEBUG;HAVE_WINDOWS_H;OPENVRML_GL_BUILD_DLL;OPENVRML_USE_DLL" --- 125,128 ---- |
From: Braden M. <br...@us...> - 2007-05-14 21:08:03
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/antlr In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351/ide-projects/Windows/VisualC8_0/OpenVRML/antlr Modified Files: antlr.vcproj Log Message: Visual C++ 8.0 project file updates. Index: antlr.vcproj =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/antlr/antlr.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** antlr.vcproj 29 Apr 2007 04:06:48 -0000 1.5 --- antlr.vcproj 14 May 2007 21:08:03 -0000 1.6 *************** *** 42,45 **** --- 42,46 ---- Optimization="0" AdditionalIncludeDirectories="..\..\..\..\..\lib\antlr" + PreprocessorDefinitions="NO_STATIC_CONSTS" MinimalRebuild="false" BasicRuntimeChecks="0" *************** *** 88,91 **** --- 89,93 ---- ConfigurationType="4" CharacterSet="2" + WholeProgramOptimization="1" > <Tool *************** *** 109,115 **** InlineFunctionExpansion="1" OmitFramePointers="true" - WholeProgramOptimization="true" AdditionalIncludeDirectories="..\..\..\..\..\lib\antlr" ! PreprocessorDefinitions="NDEBUG" StringPooling="true" RuntimeLibrary="2" --- 111,116 ---- InlineFunctionExpansion="1" OmitFramePointers="true" AdditionalIncludeDirectories="..\..\..\..\..\lib\antlr" ! PreprocessorDefinitions="NDEBUG;NO_STATIC_CONSTS" StringPooling="true" RuntimeLibrary="2" *************** *** 252,255 **** --- 253,260 ---- </File> <File + RelativePath="..\..\..\..\..\lib\antlr\src\TokenRefCount.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\lib\antlr\src\TokenStreamBasicFilter.cpp" > *************** *** 421,424 **** --- 426,433 ---- </File> <File + RelativePath="..\..\..\..\..\lib\antlr\antlr\TokenRefCount.hpp" + > + </File> + <File RelativePath="..\..\..\..\..\lib\antlr\antlr\TokenStream.hpp" > |
From: Braden M. <br...@us...> - 2007-05-14 21:08:03
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml Modified Files: openvrml.vcproj Log Message: Visual C++ 8.0 project file updates. Index: openvrml.vcproj =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/openvrml/openvrml.vcproj,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** openvrml.vcproj 30 Apr 2007 07:37:25 -0000 1.12 --- openvrml.vcproj 14 May 2007 21:08:03 -0000 1.13 *************** *** 43,47 **** Optimization="0" AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\lib\antlr" ! PreprocessorDefinitions="WIN32;NOMINMAX;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.16.4\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const"" MinimalRebuild="false" BasicRuntimeChecks="0" --- 43,47 ---- Optimization="0" AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\lib\antlr" ! PreprocessorDefinitions="WIN32;NOMINMAX;PACKAGE_VERSION=\"0.16.4\";NO_STATIC_CONSTS;BOOST_SPIRIT_THREADSAFE;BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const"" MinimalRebuild="false" BasicRuntimeChecks="0" *************** *** 68,73 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="freetype221MT_D.lib" OutputFile="$(SolutionDir)..\bin\$(ProjectName)d.dll" GenerateDebugInformation="true" ImportLibrary="$(SolutionDir)..\lib\$(TargetName).lib" --- 68,74 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib freetype234MT_D.lib" OutputFile="$(SolutionDir)..\bin\$(ProjectName)d.dll" + IgnoreDefaultLibraryNames="libcmtd.lib" GenerateDebugInformation="true" ImportLibrary="$(SolutionDir)..\lib\$(TargetName).lib" *************** *** 104,107 **** --- 105,109 ---- ConfigurationType="2" CharacterSet="2" + WholeProgramOptimization="1" > <Tool *************** *** 126,130 **** InlineFunctionExpansion="1" OmitFramePointers="true" - WholeProgramOptimization="true" AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\lib\antlr" PreprocessorDefinitions="WIN32;NOMINMAX;BOOST_SPIRIT_THREADSAFE;NDEBUG;PACKAGE_VERSION=\"0.16.4\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const"" --- 128,131 ---- *************** *** 153,158 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="freetype221MT.lib" OutputFile="$(SolutionDir)..\bin\$(ProjectName).dll" LinkTimeCodeGeneration="1" ImportLibrary="$(SolutionDir)..\lib\$(TargetName).lib" --- 154,160 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib freetype234MT.lib" OutputFile="$(SolutionDir)..\bin\$(ProjectName).dll" + IgnoreDefaultLibraryNames="libcmt.lib" LinkTimeCodeGeneration="1" ImportLibrary="$(SolutionDir)..\lib\$(TargetName).lib" |
From: Braden M. <br...@us...> - 2007-05-14 21:08:03
|
Update of /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21351/ide-projects/Windows/VisualC8_0/OpenVRML Modified Files: OpenVRML.sln Log Message: Visual C++ 8.0 project file updates. Index: OpenVRML.sln =================================================================== RCS file: /cvsroot/openvrml/openvrml/ide-projects/Windows/VisualC8_0/OpenVRML/OpenVRML.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OpenVRML.sln 22 Sep 2006 22:23:09 -0000 1.3 --- OpenVRML.sln 14 May 2007 21:08:02 -0000 1.4 *************** *** 15,21 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdl-viewer", "sdl-viewer\sdl-viewer.vcproj", "{2DD5D192-3E85-4E64-854B-DF7A1FF06B76}" ProjectSection(ProjectDependencies) = postProject - {141F90C2-6630-4D7A-834F-D5D57C6CFC24} = {141F90C2-6630-4D7A-834F-D5D57C6CFC24} {E5287CD2-4BAC-4341-AF28-A1F9C0F5949C} = {E5287CD2-4BAC-4341-AF28-A1F9C0F5949C} ! {ED407BF6-F8A1-4C7E-9952-E5454896AC63} = {ED407BF6-F8A1-4C7E-9952-E5454896AC63} EndProjectSection EndProject --- 15,20 ---- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdl-viewer", "sdl-viewer\sdl-viewer.vcproj", "{2DD5D192-3E85-4E64-854B-DF7A1FF06B76}" ProjectSection(ProjectDependencies) = postProject {E5287CD2-4BAC-4341-AF28-A1F9C0F5949C} = {E5287CD2-4BAC-4341-AF28-A1F9C0F5949C} ! {141F90C2-6630-4D7A-834F-D5D57C6CFC24} = {141F90C2-6630-4D7A-834F-D5D57C6CFC24} EndProjectSection EndProject |
From: Braden M. <br...@us...> - 2007-05-13 06:47:49
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3787 Modified Files: ChangeLog Log Message: Moved read_stream to be a member of openvrml::scene. We need to hang a thread group for these threads somewhere so we can join them; and the scene would seem to be a reasonable place. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1497 retrieving revision 1.1498 diff -C2 -d -r1.1497 -r1.1498 *** ChangeLog 13 May 2007 00:46:33 -0000 1.1497 --- ChangeLog 13 May 2007 06:47:26 -0000 1.1498 *************** *** 1,2 **** --- 1,26 ---- + 2007-05-13 Braden McDaniel <br...@en...> + + Moved read_stream to be a member of openvrml::scene. We need to + hang a thread group for these threads somewhere so we can join + them; and the scene would seem to be a reasonable place. + + * src/libopenvrml/openvrml/browser.cpp + (openvrml::read_stream(std::auto_ptr<resource_istream>, + std::auto_ptr<stream_listener>)): Removed. + (openvrml::scene::~scene()): Join any stream reader threads. + (openvrml::scene::read_stream(std::auto_ptr<resource_istream>, + std::auto_ptr<stream_listener>)): Read a stream. + * src/libopenvrml/openvrml/browser.h + (openvrml::read_stream(std::auto_ptr<resource_istream>, + std::auto_ptr<stream_listener>)): Removed. + (openvrml::scene): Added members stream_reader_threads_ and + read_stream. + * src/libopenvrml/openvrml/vrml97node.cpp + (update_texture(background_node &, boost::recursive_mutex &, const + openvrml::mfstring &, openvrml::image &)): Call read_stream on the + scene. + (image_texture_node::update_texture()): Call read_stream on the + scene. + 2007-05-12 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-13 06:47:49
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3787/src/libopenvrml/openvrml Modified Files: browser.cpp browser.h vrml97node.cpp Log Message: Moved read_stream to be a member of openvrml::scene. We need to hang a thread group for these threads somewhere so we can join them; and the scene would seem to be a reasonable place. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** browser.cpp 13 May 2007 00:46:33 -0000 1.210 --- browser.cpp 13 May 2007 06:47:28 -0000 1.211 *************** *** 4839,4895 **** */ - namespace { - - struct OPENVRML_LOCAL stream_reader { - stream_reader(std::auto_ptr<openvrml::resource_istream> in, - std::auto_ptr<openvrml::stream_listener> listener): - in_(in), - listener_(listener) - {} - - void operator()() const - { - this->listener_->stream_available(this->in_->url(), - this->in_->type()); - while (*this->in_) { - std::vector<unsigned char> data; - while (this->in_->data_available()) { - using openvrml::resource_istream; - const resource_istream::int_type c = this->in_->get(); - if (c != resource_istream::traits_type::eof()) { - data.push_back( - resource_istream::traits_type::to_char_type(c)); - } else { - break; - } - } - if (!data.empty()) { - this->listener_->data_available(data); - } - } - } - - private: - boost::shared_ptr<openvrml::resource_istream> in_; - boost::shared_ptr<openvrml::stream_listener> listener_; - }; - } - - /** - * @brief Read a stream in a new thread. - * - * @c read_stream takes ownership of its arguments; the resources are released - * when reading the stream completes and the thread terminates. - * - * @param[in] in an input stream. - * @param[in] listener a stream listener. - */ - void openvrml::read_stream(std::auto_ptr<resource_istream> in, - std::auto_ptr<stream_listener> listener) - { - boost::function0<void> f = stream_reader(in, listener); - boost::thread t(f); - } - /** * @class openvrml::invalid_vrml openvrml/browser.h --- 4839,4842 ---- *************** *** 6956,6960 **** */ openvrml::scene::~scene() OPENVRML_NOTHROW ! {} /** --- 6903,6909 ---- */ openvrml::scene::~scene() OPENVRML_NOTHROW ! { ! this->stream_reader_threads_.join_all(); ! } /** *************** *** 7189,7192 **** --- 7138,7194 ---- } + namespace { + + struct OPENVRML_LOCAL stream_reader { + stream_reader(std::auto_ptr<openvrml::resource_istream> in, + std::auto_ptr<openvrml::stream_listener> listener): + in_(in), + listener_(listener) + {} + + void operator()() const + { + this->listener_->stream_available(this->in_->url(), + this->in_->type()); + while (*this->in_) { + std::vector<unsigned char> data; + while (this->in_->data_available()) { + using openvrml::resource_istream; + const resource_istream::int_type c = this->in_->get(); + if (c != resource_istream::traits_type::eof()) { + data.push_back( + resource_istream::traits_type::to_char_type(c)); + } else { + break; + } + } + if (!data.empty()) { + this->listener_->data_available(data); + } + } + } + + private: + boost::shared_ptr<openvrml::resource_istream> in_; + boost::shared_ptr<openvrml::stream_listener> listener_; + }; + } + + /** + * @brief Read a stream in a new thread. + * + * @c #read_stream takes ownership of its arguments; the resources are released + * when reading the stream completes and the thread terminates. + * + * @param[in] in an input stream. + * @param[in] listener a stream listener. + */ + void openvrml::scene::read_stream(std::auto_ptr<resource_istream> in, + std::auto_ptr<stream_listener> listener) + { + boost::function0<void> f = stream_reader(in, listener); + this->stream_reader_threads_.create_thread(f); + } + /** * @brief Load a resource into @a browser. Index: browser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** browser.h 13 May 2007 00:46:34 -0000 1.64 --- browser.h 13 May 2007 06:47:28 -0000 1.65 *************** *** 81,87 **** }; - OPENVRML_API void read_stream(std::auto_ptr<resource_istream> in, - std::auto_ptr<stream_listener> listener); - class OPENVRML_API invalid_vrml : public std::runtime_error { --- 81,84 ---- *************** *** 374,377 **** --- 371,376 ---- std::map<std::string, std::string> meta_; + boost::thread_group stream_reader_threads_; + public: explicit scene(openvrml::browser & browser, scene * parent = 0) *************** *** 402,405 **** --- 401,406 ---- get_resource(const std::vector<std::string> & url) const OPENVRML_THROW2(no_alternative_url, std::bad_alloc); + void read_stream(std::auto_ptr<resource_istream> in, + std::auto_ptr<stream_listener> listener); void shutdown(double timestamp) OPENVRML_NOTHROW; Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** vrml97node.cpp 13 May 2007 00:46:35 -0000 1.128 --- vrml97node.cpp 13 May 2007 06:47:28 -0000 1.129 *************** *** 7032,7036 **** node, node_mutex)); ! read_stream(in, listener); } } catch (const openvrml::no_alternative_url &) {} --- 7032,7036 ---- node, node_mutex)); ! node.scene()->read_stream(in, listener); } } catch (const openvrml::no_alternative_url &) {} *************** *** 12482,12486 **** *this, this->mutex())); ! read_stream(in, listener); } this->texture_needs_update = false; --- 12482,12486 ---- *this, this->mutex())); ! this->scene()->read_stream(in, listener); } this->texture_needs_update = false; |
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26352/src/libopenvrml/openvrml Modified Files: browser.cpp browser.h node.cpp node.h vrml97node.cpp x3d_cad_geometry.cpp x3d_grouping.cpp Log Message: In order to be thread-safe, scene::nodes and grouping_node::children must return a copy of the vector rather than a const reference. Index: x3d_grouping.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** x3d_grouping.cpp 31 Aug 2006 06:45:34 -0000 1.4 --- x3d_grouping.cpp 13 May 2007 00:46:35 -0000 1.5 *************** *** 94,99 **** virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; virtual void recalc_bsphere(); --- 94,99 ---- virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); virtual void recalc_bsphere(); *************** *** 243,249 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<node> > & ! static_group_node::do_children() const OPENVRML_NOTHROW { return this->children_.value(); --- 243,251 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<node> > ! static_group_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { return this->children_.value(); Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** node.cpp 6 Mar 2007 07:24:01 -0000 1.91 --- node.cpp 13 May 2007 00:46:34 -0000 1.92 *************** *** 3809,3818 **** * @brief Get the children in the scene graph. * ! * This function delegates to <code>node::do_children</code>. * * @return the children in the scene graph. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! openvrml::grouping_node::children() const OPENVRML_NOTHROW { return this->do_children(); --- 3809,3820 ---- * @brief Get the children in the scene graph. * ! * This function delegates to @c node::do_children. * * @return the children in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! openvrml::grouping_node::children() const OPENVRML_THROW1(std::bad_alloc) { return this->do_children(); *************** *** 3820,3828 **** /** ! * @fn const std::vector<boost::intrusive_ptr<openvrml::node> > & openvrml::grouping_node::do_children() const * * @brief Get the children in the scene graph. * * @return the child nodes in the scene graph. */ --- 3822,3832 ---- /** ! * @fn const std::vector<boost::intrusive_ptr<openvrml::node> > openvrml::grouping_node::do_children() const * * @brief Get the children in the scene graph. * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ Index: node.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** node.h 6 Mar 2007 07:24:01 -0000 1.58 --- node.h 13 May 2007 00:46:35 -0000 1.59 *************** *** 1031,1036 **** virtual ~grouping_node() OPENVRML_NOTHROW = 0; ! const std::vector<boost::intrusive_ptr<node> > & children() const ! OPENVRML_NOTHROW; void activate_pointing_device_sensors(double timestamp, bool over, --- 1031,1036 ---- virtual ~grouping_node() OPENVRML_NOTHROW = 0; ! const std::vector<boost::intrusive_ptr<node> > children() const ! OPENVRML_THROW1(std::bad_alloc); void activate_pointing_device_sensors(double timestamp, bool over, *************** *** 1045,1050 **** private: virtual grouping_node * to_grouping() OPENVRML_NOTHROW; ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW = 0; }; --- 1045,1050 ---- private: virtual grouping_node * to_grouping() OPENVRML_NOTHROW; ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc) = 0; }; Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** vrml97node.cpp 28 Apr 2007 06:59:08 -0000 1.127 --- vrml97node.cpp 13 May 2007 00:46:35 -0000 1.128 *************** *** 1860,1865 **** virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; virtual void recalc_bsphere(); --- 1860,1865 ---- virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); virtual void recalc_bsphere(); *************** *** 2315,2322 **** * * @return the child nodes in the scene graph. */ template <typename Derived> ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! grouping_node_base<Derived>::do_children() const OPENVRML_NOTHROW { return this->children_.mfnode::value(); --- 2315,2325 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ template <typename Derived> ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! grouping_node_base<Derived>::do_children() const ! OPENVRML_THROW1(std::bad_alloc) { return this->children_.mfnode::value(); *************** *** 3164,3169 **** virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; void load(); --- 3167,3172 ---- virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); void load(); *************** *** 3189,3194 **** virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; virtual void recalc_bsphere(); }; --- 3192,3197 ---- virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); virtual void recalc_bsphere(); }; *************** *** 3786,3791 **** virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; virtual void recalc_bsphere(); }; --- 3789,3794 ---- virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); virtual void recalc_bsphere(); }; *************** *** 13671,13677 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! inline_node::do_children() const OPENVRML_NOTHROW { static const std::vector<boost::intrusive_ptr<openvrml::node> > empty; --- 13674,13682 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! inline_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { static const std::vector<boost::intrusive_ptr<openvrml::node> > empty; *************** *** 14086,14092 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! lod_node::do_children() const OPENVRML_NOTHROW { return this->current_children_.value(); --- 14091,14099 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! lod_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { return this->current_children_.value(); *************** *** 20972,20978 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! switch_node::do_children() const OPENVRML_NOTHROW { return this->current_children_.value(); --- 20979,20987 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! switch_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { return this->current_children_.value(); *************** *** 27037,27042 **** virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const throw (); virtual void recalc_bsphere(); }; --- 27046,27051 ---- virtual void do_render_child(openvrml::viewer & viewer, rendering_context context); ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); virtual void recalc_bsphere(); }; *************** *** 27407,27413 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! cad_layer_node::do_children() const throw () { return this->current_children_.value(); --- 27416,27424 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! cad_layer_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { return this->current_children_.value(); Index: x3d_cad_geometry.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_cad_geometry.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x3d_cad_geometry.cpp 16 Apr 2007 07:40:48 -0000 1.3 --- x3d_cad_geometry.cpp 13 May 2007 00:46:35 -0000 1.4 *************** *** 104,115 **** protected: virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > & ! do_children() const OPENVRML_NOTHROW; }; - class OPENVRML_LOCAL indexed_quad_set_node : public abstract_node<indexed_quad_set_node>, - public geometry_node { friend class indexed_quad_set_metatype; --- 104,116 ---- protected: virtual const openvrml::bounding_volume & do_bounding_volume() const; ! virtual const std::vector<boost::intrusive_ptr<node> > ! do_children() const OPENVRML_THROW1(std::bad_alloc); }; + class OPENVRML_LOCAL indexed_quad_set_node : + public abstract_node<indexed_quad_set_node>, + public geometry_node { friend class indexed_quad_set_metatype; *************** *** 518,533 **** * * @return the child nodes in the scene graph. */ ! const std::vector<boost::intrusive_ptr<node> > & ! cad_face_node::do_children() const OPENVRML_NOTHROW { cad_face_node * me = const_cast<cad_face_node *>(this); ! //if there is no child ! if (shape_.sfnode::value().get() == NULL) me->children_.clear(); ! //if we have not set the child, or the child has changed. ! else if (this->children_.empty() || this->children_[0] != shape_.sfnode::value()) me->children_.assign(1, shape_.sfnode::value()); ! return children_; } --- 519,537 ---- * * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<node> > ! cad_face_node::do_children() const OPENVRML_THROW1(std::bad_alloc) { cad_face_node * me = const_cast<cad_face_node *>(this); ! // if there is no child ! if (!shape_.sfnode::value().get()) { me->children_.clear(); ! } else if (this->children_.empty() ! || this->children_[0] != shape_.sfnode::value()) { ! // if we have not set the child, or the child has changed. me->children_.assign(1, shape_.sfnode::value()); ! } return children_; } Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.209 retrieving revision 1.210 diff -C2 -d -r1.209 -r1.210 *** browser.cpp 27 Apr 2007 06:58:50 -0000 1.209 --- browser.cpp 13 May 2007 00:46:33 -0000 1.210 *************** *** 7095,7101 **** * * @return the root @c node%s for the @c scene. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > & ! openvrml::scene::nodes() const throw() { boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); --- 7095,7103 ---- * * @return the root @c node%s for the @c scene. + * + * @exception std::bad_alloc if memory allocation fails. */ ! const std::vector<boost::intrusive_ptr<openvrml::node> > ! openvrml::scene::nodes() const OPENVRML_THROW1(std::bad_alloc) { boost::recursive_mutex::scoped_lock lock(this->nodes_mutex_); Index: browser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** browser.h 6 Mar 2007 03:26:15 -0000 1.63 --- browser.h 13 May 2007 00:46:34 -0000 1.64 *************** *** 389,394 **** const std::vector<std::string> meta_keys() const OPENVRML_THROW1(std::bad_alloc); ! const std::vector<boost::intrusive_ptr<node> > & nodes() const ! OPENVRML_NOTHROW; void nodes(const std::vector<boost::intrusive_ptr<node> > & n) OPENVRML_THROW2(std::invalid_argument, std::bad_alloc); --- 389,394 ---- const std::vector<std::string> meta_keys() const OPENVRML_THROW1(std::bad_alloc); ! const std::vector<boost::intrusive_ptr<node> > nodes() const ! OPENVRML_THROW1(std::bad_alloc); void nodes(const std::vector<boost::intrusive_ptr<node> > & n) OPENVRML_THROW2(std::invalid_argument, std::bad_alloc); |
From: Braden M. <br...@us...> - 2007-05-13 00:46:34
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26352 Modified Files: ChangeLog Log Message: In order to be thread-safe, scene::nodes and grouping_node::children must return a copy of the vector rather than a const reference. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1496 retrieving revision 1.1497 diff -C2 -d -r1.1496 -r1.1497 *** ChangeLog 12 May 2007 03:43:42 -0000 1.1496 --- ChangeLog 13 May 2007 00:46:33 -0000 1.1497 *************** *** 1,2 **** --- 1,39 ---- + 2007-05-12 Braden McDaniel <br...@en...> + + In order to be thread-safe, scene::nodes and + grouping_node::children must return a copy of the vector rather + than a const reference. + + * src/libopenvrml/openvrml/browser.cpp + (openvrml::scene::nodes() const): Return the vector of nodes as a + copy. As a consequence of this, the function could throw + std::bad_alloc. + * src/libopenvrml/openvrml/browser.h + (openvrml::scene): Changed nodes accessor to return a copy of the + node vector. + * src/libopenvrml/openvrml/node.cpp + (openvrml::grouping_node::children() const): Return the vector of + nodes as a copy. As a consequence of this, the function could + throw std::bad_alloc. + * src/libopenvrml/openvrml/node.h + (openvrml::grouping_node): Changed children and do_children + members to return the node vector by copy (rather than by const + reference). + * src/libopenvrml/openvrml/vrml97node.cpp + (grouping_node_base): Changed do_children member to return the + node vector by copy. + (inline_node): Changed do_children member to return the node + vector by copy. + (lod_node): Changed do_children member to return the node vector + by copy. + (switch_node): Changed do_children member to return the node + vector by copy. + * src/libopenvrml/openvrml/x3d_cad_geometry.cpp + (cad_face_node): Changed do_children member to return the node + vector by copy. + * src/libopenvrml/openvrml/x3d_grouping.cpp + (static_group_node): Changed do_children member to return the node + vector by copy. + 2007-05-11 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-05-12 03:43:42
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31922 Modified Files: ChangeLog Log Message: Fixed reference. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1495 retrieving revision 1.1496 diff -C2 -d -r1.1495 -r1.1496 *** ChangeLog 12 May 2007 03:29:41 -0000 1.1495 --- ChangeLog 12 May 2007 03:43:42 -0000 1.1496 *************** *** 1,4 **** --- 1,8 ---- 2007-05-11 Braden McDaniel <br...@en...> + * doc/index.doc: Fixed reference. + + 2007-05-11 Braden McDaniel <br...@en...> + Protect the plugin_streambuf_map with a mutex. |
From: Braden M. <br...@us...> - 2007-05-12 03:43:42
|
Update of /cvsroot/openvrml/openvrml/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31922/doc Modified Files: index.doc Log Message: Fixed reference. Index: index.doc =================================================================== RCS file: /cvsroot/openvrml/openvrml/doc/index.doc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.doc 22 Nov 2006 00:05:18 -0000 1.5 --- index.doc 12 May 2007 03:43:42 -0000 1.6 *************** *** 15,19 **** * <tr><td>@ref resource_fetching</td></tr> * <tr><td>@ref resource_fetching_rationale</td></tr> ! * <tr><td>@ref introducing_resource_istream</td></tr> * <tr><td>@ref introducing_browser</td></tr> * <tr><td>@ref resource_istream_impl_considerations</td></tr> --- 15,19 ---- * <tr><td>@ref resource_fetching</td></tr> * <tr><td>@ref resource_fetching_rationale</td></tr> ! * <tr><td>@ref resource_istream</td></tr> * <tr><td>@ref introducing_browser</td></tr> * <tr><td>@ref resource_istream_impl_considerations</td></tr> |
From: Braden M. <br...@us...> - 2007-05-12 03:29:43
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26508/src/openvrml-xembed Modified Files: main.cpp plugin_streambuf.cpp plugin_streambuf.h Log Message: Protect the plugin_streambuf_map with a mutex. Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plugin_streambuf.cpp 15 Mar 2007 22:41:57 -0000 1.4 --- plugin_streambuf.cpp 12 May 2007 03:29:41 -0000 1.5 *************** *** 72,77 **** this->initialized_ = true; const boost::shared_ptr<plugin_streambuf> this_ = shared_from_this(); ! succeeded = plugin_streambuf_map.insert(make_pair(stream_id, this_)) ! .second; g_assert(succeeded); this->streambuf_initialized_or_failed_.notify_all(); --- 72,76 ---- this->initialized_ = true; const boost::shared_ptr<plugin_streambuf> this_ = shared_from_this(); ! succeeded = plugin_streambuf_map_.insert(stream_id, this_); g_assert(succeeded); this->streambuf_initialized_or_failed_.notify_all(); *************** *** 139,146 **** } - - openvrml_xembed::uninitialized_plugin_streambuf_map - openvrml_xembed::uninitialized_plugin_streambuf_map_; - const boost::shared_ptr<openvrml_xembed::plugin_streambuf> openvrml_xembed::uninitialized_plugin_streambuf_map:: --- 138,141 ---- *************** *** 203,206 **** } ! openvrml_xembed::plugin_streambuf_map_t openvrml_xembed::plugin_streambuf_map; --- 198,235 ---- } + openvrml_xembed::uninitialized_plugin_streambuf_map + openvrml_xembed::uninitialized_plugin_streambuf_map_; ! ! const boost::shared_ptr<openvrml_xembed::plugin_streambuf> ! openvrml_xembed::plugin_streambuf_map::find(const size_t id) const ! { ! boost::mutex::scoped_lock lock(this->mutex_); ! map_t::const_iterator pos = this->map_.find(id); ! return pos == this->map_.end() ! ? boost::shared_ptr<plugin_streambuf>() ! : pos->second; ! } ! ! bool ! openvrml_xembed::plugin_streambuf_map:: ! insert(const size_t id, ! const boost::shared_ptr<plugin_streambuf> & streambuf) ! { ! boost::mutex::scoped_lock lock(this->mutex_); ! return this->map_.insert(make_pair(id, streambuf)).second; ! } ! ! /** ! * @brief Erase the entry corresponding to @p id. ! * ! * @return @c true if an entry was removed; @c false otherwise. ! */ ! bool openvrml_xembed::plugin_streambuf_map::erase(const size_t id) ! { ! boost::mutex::scoped_lock lock(this->mutex_); ! return this->map_.erase(id) > 0; ! } ! ! openvrml_xembed::plugin_streambuf_map ! openvrml_xembed::plugin_streambuf_map_; Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 15 Mar 2007 22:41:57 -0000 1.6 --- main.cpp 12 May 2007 03:29:41 -0000 1.7 *************** *** 71,74 **** --- 71,75 ---- string command_line; while (getline(*this->in_, command_line)) { + using boost::shared_ptr; using std::istringstream; *************** *** 77,82 **** command_line_stream >> command; if (command == "get-url-result") { - using boost::shared_ptr; - std::string url; int result; --- 78,81 ---- *************** *** 88,93 **** streambuf->set_get_url_result(result); } else if (command == "new-stream") { - using boost::shared_ptr; - size_t stream_id; std::string type, url; --- 87,90 ---- *************** *** 115,137 **** size_t stream_id; command_line_stream >> stream_id; ! plugin_streambuf_map_t::iterator pos = ! plugin_streambuf_map.find(stream_id); ! if (pos == plugin_streambuf_map.end()) { ! g_warning("Attempt to destroy a nonexistent stream."); continue; } ! pos->second->buf_.set_eof(); ! plugin_streambuf_map.erase(pos); } else if (command == "write") { size_t stream_id, length; command_line_stream >> stream_id >> length; ! plugin_streambuf_map_t::const_iterator pos = ! plugin_streambuf_map.find(stream_id); ! if (pos == plugin_streambuf_map.end()) { g_warning("Attempt to write to a nonexistent stream."); continue; } for (size_t i = 0; i < length; ++i) { ! pos->second->buf_.put(this->in_->get()); } } else if (command == "load-url") { --- 112,135 ---- size_t stream_id; command_line_stream >> stream_id; ! const shared_ptr<plugin_streambuf> streambuf = ! plugin_streambuf_map_.find(stream_id); ! if (!streambuf) { ! g_warning("Attempt to destroy a nonexistent stream " ! "(with stream ID %lu).", stream_id); continue; } ! streambuf->buf_.set_eof(); ! plugin_streambuf_map_.erase(stream_id); } else if (command == "write") { size_t stream_id, length; command_line_stream >> stream_id >> length; ! const shared_ptr<plugin_streambuf> streambuf = ! plugin_streambuf_map_.find(stream_id); ! if (!streambuf) { g_warning("Attempt to write to a nonexistent stream."); continue; } for (size_t i = 0; i < length; ++i) { ! streambuf->buf_.put(this->in_->get()); } } else if (command == "load-url") { Index: plugin_streambuf.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plugin_streambuf.h 12 Feb 2007 02:19:30 -0000 1.3 --- plugin_streambuf.h 12 May 2007 03:29:41 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- # include <set> # include <streambuf> + # include <boost/noncopyable.hpp> # include <boost/shared_ptr.hpp> # include <boost/enable_shared_from_this.hpp> *************** *** 66,70 **** }; ! extern class uninitialized_plugin_streambuf_map { mutable boost::mutex mutex_; typedef std::multimap<std::string, boost::shared_ptr<plugin_streambuf> > --- 67,71 ---- }; ! extern class uninitialized_plugin_streambuf_map : boost::noncopyable { mutable boost::mutex mutex_; typedef std::multimap<std::string, boost::shared_ptr<plugin_streambuf> > *************** *** 83,91 **** } uninitialized_plugin_streambuf_map_; ! typedef std::map<size_t, boost::shared_ptr<plugin_streambuf> > ! plugin_streambuf_map_t; ! ! extern plugin_streambuf_map_t plugin_streambuf_map; } --- 84,98 ---- } uninitialized_plugin_streambuf_map_; + extern class plugin_streambuf_map : boost::noncopyable { + mutable boost::mutex mutex_; + typedef std::map<size_t, boost::shared_ptr<plugin_streambuf> > map_t; + map_t map_; ! public: ! const boost::shared_ptr<plugin_streambuf> find(size_t id) const; ! bool insert(size_t id, ! const boost::shared_ptr<plugin_streambuf> & streambuf); ! bool erase(size_t id); ! } plugin_streambuf_map_; } |