Skip to content
Snippets Groups Projects
Commit 649d0847 authored by Yohann Bearzi (Kitware)'s avatar Yohann Bearzi (Kitware)
Browse files

vtkThreadedCallbackQueue: inlining few implementations

2 implementations were in the .txx file and cause linking errors in
  ParaView
parent 68061ec5
No related branches found
No related tags found
No related merge requests found
...@@ -113,12 +113,27 @@ public: ...@@ -113,12 +113,27 @@ public:
public: public:
vtkBaseTypeMacro(vtkSharedFutureBase, vtkObjectBase); vtkBaseTypeMacro(vtkSharedFutureBase, vtkObjectBase);
vtkSharedFutureBase(); vtkSharedFutureBase()
: NumberOfPriorSharedFuturesRemaining(0)
, Status(CONSTRUCTING)
{
}
/** /**
* Blocks current thread until the task associated with this future has terminated. * Blocks current thread until the task associated with this future has terminated.
*/ */
virtual void Wait() const; virtual void Wait() const
{
if (this->Status == READY)
{
return;
}
std::unique_lock<std::mutex> lock(this->Mutex);
if (this->Status != READY)
{
this->ConditionVariable.wait(lock, [this] { return this->Status == READY; });
}
}
friend class vtkThreadedCallbackQueue; friend class vtkThreadedCallbackQueue;
......
...@@ -24,27 +24,6 @@ ...@@ -24,27 +24,6 @@
VTK_ABI_NAMESPACE_BEGIN VTK_ABI_NAMESPACE_BEGIN
//-----------------------------------------------------------------------------
vtkThreadedCallbackQueue::vtkSharedFutureBase::vtkSharedFutureBase()
: NumberOfPriorSharedFuturesRemaining(0)
, Status(CONSTRUCTING)
{
}
//-----------------------------------------------------------------------------
void vtkThreadedCallbackQueue::vtkSharedFutureBase::Wait() const
{
if (this->Status == READY)
{
return;
}
std::unique_lock<std::mutex> lock(this->Mutex);
if (this->Status != READY)
{
this->ConditionVariable.wait(lock, [this] { return this->Status == READY; });
}
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <> template <>
struct vtkThreadedCallbackQueue::ReturnValueWrapper<void, false> struct vtkThreadedCallbackQueue::ReturnValueWrapper<void, false>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment