Home | History | Annotate | Download | only in threading
      1 // Copyright 2017 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/sequence_local_storage_slot.h"
      6 
      7 #include <limits>
      8 
      9 #include "base/atomic_sequence_num.h"
     10 #include "base/logging.h"
     11 
     12 namespace base {
     13 namespace internal {
     14 
     15 namespace {
     16 AtomicSequenceNumber g_sequence_local_storage_slot_generator;
     17 }  // namespace
     18 
     19 int GetNextSequenceLocalStorageSlotNumber() {
     20   int slot_id = g_sequence_local_storage_slot_generator.GetNext();
     21   DCHECK_LT(slot_id, std::numeric_limits<int>::max());
     22   return slot_id;
     23 }
     24 
     25 }  // namespace internal
     26 }  // namespace base
     27