Exemplo n.º 1
0
void CacheManager::invalidateAll()
{
	HandleSet workset;

	workset.swap(_validHandles);
	for (HandleSet::iterator itr = workset.begin(), end = workset.end(); itr != end; ++itr)
	{
		CacheHandle* handle = *itr;
		handle->invalidate();
	}
	workset.clear();

	_wiredCount = 0;
	_wiredFootprint = 0;

	_activeCount = 0;
	_activeFootprint = 0;

	_inactiveCount = 0;
	_inactiveFootprint = 0;
}
Exemplo n.º 2
0
int
SocketStream::handleReady (ACE_HANDLE handle,
                            const TimeValue *timeout,
                            int readReady,
                            int writeReady,
                            int exceptionReady)
{
  HandleSet handleSet;
  handleSet.setBit(handle);

  // Wait for data or for the timeout to elapse.
  int selectWidth;
#  if defined (ACE_WIN32)
  // This arg is ignored on Windows and causes pointer truncation
  // warnings on 64-bit compiles.
  selectWidth = 0;
#  else
  selectWidth = int (handle) + 1;
#  endif /* ACE_WIN64 */
  int result = OS::select (selectWidth,
                               readReady ? handleSet.fdset () : 0, // read_fds.
                               writeReady ? handleSet.fdset () : 0, // write_fds.
                               exceptionReady ? handleSet.fdset () : 0, // exception_fds.
                               timeout);

  switch (result)    {
    case 0:  // Timer expired.
      errno = ETIME;
      /* FALLTHRU */
    case -1: // we got here directly - select() returned -1.
      return -1;
    case 1: // Handle has data.
      /* FALLTHRU */
    default: // default is case result > 0; return a
      // ACE_ASSERT (result == 1);
      return result;
  }
}
Exemplo n.º 3
0
// avoid loops by passing history of objects traversed via handles argument
void StorageBase::SetColorRecursive(ObjectColor::Color color, HandleSet& handles)
{
    Handle handle = GetHandle();
    if (handles.find(handle) != handles.end())
        return;

    handles.insert(handle);

    if (!SetColor(color))
        return;

    GetClass()->SetReferencedObjectsColor(*this, color, handles);
    if (dictionary.empty())
        return;

    for (Dictionary::value_type const &child : dictionary)
    {
        StorageBase *sub = GetRegistry()->GetStorageBase(child.second.GetHandle());
        if (!sub)
            continue;

        sub->SetColorRecursive(color, handles);
    }
}