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 merge requests found
......@@ -113,12 +113,27 @@ public:
public:
vtkBaseTypeMacro(vtkSharedFutureBase, vtkObjectBase);
vtkSharedFutureBase();
vtkSharedFutureBase()
: NumberOfPriorSharedFuturesRemaining(0)
, Status(CONSTRUCTING)
{
}
/**
* 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;
......
......@@ -24,27 +24,6 @@
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 <>
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