c_BlockableWaitHandle* c_BlockableWaitHandle::unblock() {
  c_BlockableWaitHandle* next = m_nextParent;

  // notify subclass that we are no longer blocked
  onUnblocked();

  // decrement ref count, we can't be called by child anymore
  decRefObj(this);

  return next;
}
void c_GenArrayWaitHandle::initialize(CObjRef exception, CArrRef deps, ssize_t iter_pos, c_WaitableWaitHandle* child) {
  m_exception = exception;
  m_deps = deps;
  m_iterPos = iter_pos;
  try {
    blockOn(child);
  } catch (const Object& cycle_exception) {
    putException(m_exception, cycle_exception.get());
    m_iterPos = m_deps->iter_advance(m_iterPos);
    onUnblocked();
  }
}
void c_GenVectorWaitHandle::initialize(CObjRef exception, c_Vector* deps, int64_t iter_pos, c_WaitableWaitHandle* child) {
  m_exception = exception;
  m_deps = deps;
  m_iterPos = iter_pos;
  try {
    blockOn(child);
  } catch (const Object& cycle_exception) {
    putException(m_exception, cycle_exception.get());
    ++m_iterPos;
    onUnblocked();
  }
}
예제 #4
0
void c_GenVectorWaitHandle::initialize(const Object& exception, c_Vector* deps, int64_t iter_pos, c_WaitableWaitHandle* child) {
  m_exception = exception;
  m_deps = deps;
  m_iterPos = iter_pos;

  if (isInContext()) {
    try {
      child->enterContext(getContextIdx());
    } catch (const Object& cycle_exception) {
      putException(m_exception, cycle_exception.get());
      ++m_iterPos;
      onUnblocked();
      return;
    }
  }

  blockOn(child);
}
예제 #5
0
void c_GenMapWaitHandle::initialize(CObjRef exception, c_Map* deps, ssize_t iter_pos, c_WaitableWaitHandle* child) {
  m_exception = exception;
  m_deps = deps;
  m_iterPos = iter_pos;

  if (isInContext()) {
    try {
      child->enterContext(getContextIdx());
    } catch (const Object& cycle_exception) {
      putException(m_exception, cycle_exception.get());
      m_iterPos = m_deps->iter_next(m_iterPos);
      onUnblocked();
      return;
    }
  }

  blockOn(child);
}