• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 namespace base {
8 namespace internal {
9 
10 // static
AllocateSlot(SlotType * slot)11 void ThreadLocalPlatform::AllocateSlot(SlotType* slot) {
12   slot->Initialize(nullptr);
13 }
14 
15 // static
FreeSlot(SlotType slot)16 void ThreadLocalPlatform::FreeSlot(SlotType slot) {
17   slot.Free();
18 }
19 
20 // static
GetValueFromSlot(SlotType slot)21 void* ThreadLocalPlatform::GetValueFromSlot(SlotType slot) {
22   return slot.Get();
23 }
24 
25 // static
SetValueInSlot(SlotType slot,void * value)26 void ThreadLocalPlatform::SetValueInSlot(SlotType slot, void* value) {
27   slot.Set(value);
28 }
29 
30 }  // namespace internal
31 }  // namespace base
32