1 // Copyright (c) 2006-2008 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.
5 #ifndef BASE_ATOMIC_SEQUENCE_NUM_H_
6 #define BASE_ATOMIC_SEQUENCE_NUM_H_
9 #include "base/atomicops.h"
10 #include "base/basictypes.h"
14 class AtomicSequenceNumber {
16 AtomicSequenceNumber() : seq_(0) { }
17 explicit AtomicSequenceNumber(base::LinkerInitialized x) { /* seq_ is 0 */ }
20 return static_cast<int>(
21 base::subtle::NoBarrier_AtomicIncrement(&seq_, 1) - 1);
25 base::subtle::Atomic32 seq_;
26 DISALLOW_COPY_AND_ASSIGN(AtomicSequenceNumber);
31 #endif // BASE_ATOMIC_SEQUENCE_NUM_H_