mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[libBasic] Add documentation comments for ThreadSafeRefCounted.h
Swift SVN r9654
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//===--- ThreadSafeRefCounted.h - -------------------------------*- C++ -*-===//
|
||||
//===--- ThreadSafeRefCounted.h - Thread-safe Refcounting Base --*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -9,8 +9,6 @@
|
||||
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef SWIFT_BASIC_THREADSAFEREFCOUNTED_H
|
||||
#define SWIFT_BASIC_THREADSAFEREFCOUNTED_H
|
||||
@@ -20,7 +18,13 @@
|
||||
|
||||
namespace swift {
|
||||
|
||||
/// \brief A thread-safe version of llvm::RefCountedBase.
|
||||
/// A thread-safe version of \c llvm::RefCountedBase.
|
||||
///
|
||||
/// A generic base class for objects that wish to have their lifetimes managed
|
||||
/// using reference counts. Classes subclass \c ThreadSafeRefCountedBase to
|
||||
/// obtain such functionality, and are typically handled with
|
||||
/// \c IntrusiveRefCntPtr "smart pointers" which automatically handle the
|
||||
/// management of reference counts.
|
||||
/// FIXME: This should eventually move to llvm.
|
||||
template <class Derived>
|
||||
class ThreadSafeRefCountedBase {
|
||||
@@ -41,6 +45,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// A class that has the same function as \c ThreadSafeRefCountedBase, but with
|
||||
/// a virtual destructor.
|
||||
///
|
||||
/// Should be used instead of \c ThreadSafeRefCountedBase for classes that
|
||||
/// already have virtual methods to enforce dynamic allocation via 'new'.
|
||||
/// FIXME: This should eventually move to llvm.
|
||||
class ThreadSafeRefCountedBaseVPTR {
|
||||
mutable llvm::sys::cas_flag ref_cnt;
|
||||
virtual void anchor();
|
||||
|
||||
Reference in New Issue
Block a user