Fix compilation when building without threads enabled

This commit is contained in:
rdb 2017-03-09 14:31:07 +01:00
parent 3db8ce2562
commit 4f299fa71f
2 changed files with 54 additions and 0 deletions

View File

@ -283,6 +283,31 @@ GeomVertexArrayDataHandle(CPT(GeomVertexArrayData) object,
#endif
}
/**
*
*/
INLINE GeomVertexArrayDataHandle::
GeomVertexArrayDataHandle(const GeomVertexArrayData *object,
Thread *current_thread) :
_object((GeomVertexArrayData *)object),
_current_thread(current_thread),
_cdata((GeomVertexArrayData::CData *)object->_cycler.read_unlocked(current_thread)),
_writable(false)
{
#ifdef _DEBUG
nassertv(_object->test_ref_count_nonzero());
#endif // _DEBUG
#ifdef DO_PIPELINING
_cdata->ref();
#endif // DO_PIPELINING
// We must grab the lock *after* we have incremented the reference count,
// above.
_cdata->_rw_lock.acquire();
#ifdef DO_MEMORY_USAGE
MemoryUsage::update_type(this, get_class_type());
#endif
}
/**
*
*/
@ -309,6 +334,31 @@ GeomVertexArrayDataHandle(PT(GeomVertexArrayData) object,
#endif
}
/**
*
*/
INLINE GeomVertexArrayDataHandle::
GeomVertexArrayDataHandle(GeomVertexArrayData *object,
Thread *current_thread) :
_object(object),
_current_thread(current_thread),
_cdata(object->_cycler.write_upstream(true, current_thread)),
_writable(true)
{
#ifdef _DEBUG
nassertv(_object->test_ref_count_nonzero());
#endif // _DEBUG
#ifdef DO_PIPELINING
_cdata->ref();
#endif // DO_PIPELINING
// We must grab the lock *after* we have incremented the reference count,
// above.
_cdata->_rw_lock.acquire();
#ifdef DO_MEMORY_USAGE
MemoryUsage::update_type(this, get_class_type());
#endif
}
/**
* Don't attempt to copy these objects.
*/

View File

@ -250,8 +250,12 @@ class EXPCL_PANDA_GOBJ GeomVertexArrayDataHandle : public ReferenceCount, public
private:
INLINE GeomVertexArrayDataHandle(CPT(GeomVertexArrayData) object,
Thread *current_thread);
INLINE GeomVertexArrayDataHandle(const GeomVertexArrayData *object,
Thread *current_thread);
INLINE GeomVertexArrayDataHandle(PT(GeomVertexArrayData) object,
Thread *current_thread);
INLINE GeomVertexArrayDataHandle(GeomVertexArrayData *object,
Thread *current_thread);
INLINE GeomVertexArrayDataHandle(const GeomVertexArrayDataHandle &);
INLINE void operator = (const GeomVertexArrayDataHandle &);