1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/threading/thread_local.h" 6 7 #include "base/logging.h" 8 9 namespace base { 10 namespace internal { 11 12 // static AllocateSlot(SlotType * slot)13void ThreadLocalPlatform::AllocateSlot(SlotType* slot) { 14 bool succeed = slot->Initialize(NULL); 15 CHECK(succeed); 16 } 17 18 // static FreeSlot(SlotType slot)19void ThreadLocalPlatform::FreeSlot(SlotType slot) { 20 slot.Free(); 21 } 22 23 // static GetValueFromSlot(SlotType slot)24void* ThreadLocalPlatform::GetValueFromSlot(SlotType slot) { 25 return slot.Get(); 26 } 27 28 // static SetValueInSlot(SlotType slot,void * value)29void ThreadLocalPlatform::SetValueInSlot(SlotType slot, void* value) { 30 slot.Set(value); 31 } 32 33 } // namespace internal 34 } // namespace base 35