Пример #1
0
AbstractThreadLocal::_AbstractData*
AbstractThreadLocal::_Provider::getData(unsigned index)
{
  ThreadLocalVector& tlsVector = _tlsVector();
  if (tlsVector.size() <= index)
    return 0;
  return tlsVector[index];
}
Пример #2
0
void
AbstractThreadLocal::_Provider::setData(unsigned index, AbstractThreadLocal::_AbstractData* abstractThreadLocal)
{
  ThreadLocalVector& tlsVector = _tlsVector();
  if (tlsVector.size() <= index)
    tlsVector.resize(index + 1, 0);
  delete tlsVector[index];
  tlsVector[index] = abstractThreadLocal;
}
Пример #3
0
void
AbstractThreadLocal::_Provider::setData(unsigned index, AbstractThreadLocal::_AbstractData* abstractThreadLocal)
{
  ThreadLocalVector* tlsVector = _tlsVector();
  if (!tlsVector)
    return;
  if (tlsVector->size() <= index)
    tlsVector->resize(index + 1, 0);
  delete (*tlsVector)[index];
  (*tlsVector)[index] = abstractThreadLocal;
}