summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-07-06 03:11:52 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-07-06 03:11:52 +0000
commit1516d52ffab61cb0e117f1829ede387e2d2eb021 (patch)
tree964442d73efa1774798501936ff9aaab8a370234 /libs/pbd
parent65438f0fe4abb11ce0d039f6bbd7cd74696cae9c (diff)
new automation interval configuration variable, to control automation snapshot time resolution (for oofus to test); patch for cancellingmulti-file import; minor code cleanups; use boost::fast_pool_allocator for automation lists (may revert later)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2117 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pool.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc
index be8032b7b6..6230073652 100644
--- a/libs/pbd/pool.cc
+++ b/libs/pbd/pool.cc
@@ -83,37 +83,37 @@ Pool::release (void *ptr)
MultiAllocSingleReleasePool::MultiAllocSingleReleasePool (string n, unsigned long isize, unsigned long nitems)
: Pool (n, isize, nitems),
- m_lock(0)
+ m_lock(0)
{
}
MultiAllocSingleReleasePool::~MultiAllocSingleReleasePool ()
{
- if(m_lock) delete m_lock;
+ if (m_lock) delete m_lock;
}
SingleAllocMultiReleasePool::SingleAllocMultiReleasePool (string n, unsigned long isize, unsigned long nitems)
: Pool (n, isize, nitems),
- m_lock(0)
+ m_lock(0)
{
}
SingleAllocMultiReleasePool::~SingleAllocMultiReleasePool ()
{
- if(m_lock) delete m_lock;
+ if (m_lock) delete m_lock;
}
void*
MultiAllocSingleReleasePool::alloc ()
{
void *ptr;
- if(!m_lock) {
- m_lock = new Glib::Mutex();
- // umm, I'm not sure that this doesn't also allocate memory.
- if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
- }
+
+ if (!m_lock && (m_lock = new Glib::Mutex()) == 0) {
+ fatal << "cannot create Glib::Mutex in pool.cc" << endmsg;
+ /*NOTREACHED*/
+ }
- Glib::Mutex::Lock guard(*m_lock);
+ Glib::Mutex::Lock guard(*m_lock);
ptr = Pool::alloc ();
return ptr;
}
@@ -133,12 +133,12 @@ SingleAllocMultiReleasePool::alloc ()
void
SingleAllocMultiReleasePool::release (void* ptr)
{
- if(!m_lock) {
- m_lock = new Glib::Mutex();
- // umm, I'm not sure that this doesn't also allocate memory.
- if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
- }
- Glib::Mutex::Lock guard(*m_lock);
+ if (!m_lock && (m_lock = new Glib::Mutex()) == 0) {
+ fatal << "cannot create Glib::Mutex in pool.cc" << endmsg;
+ /*NOTREACHED*/
+ }
+
+ Glib::Mutex::Lock guard(*m_lock);
Pool::release (ptr);
}