proxygen
testing::internal::linked_ptr_internal Class Reference

#include <gtest-linked_ptr.h>

Public Member Functions

void join_new ()
 
void join (linked_ptr_internal const *ptr) GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 
bool depart () GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 
void join_new ()
 
void join (linked_ptr_internal const *ptr) GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 
bool depart () GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 
void join_new ()
 
void join (linked_ptr_internal const *ptr) GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 
bool depart () GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex)
 

Private Attributes

linked_ptr_internal const * next_
 

Detailed Description

Definition at line 89 of file gtest-linked_ptr.h.

Member Function Documentation

bool testing::internal::linked_ptr_internal::depart ( )
inline

Definition at line 125 of file gtest-linked_ptr.h.

References folly::detail::lock(), and next_.

Referenced by testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::depart(), testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::operator=(), testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::reset(), and testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::~linked_ptr().

126  {
127  MutexLock lock(&g_linked_ptr_mutex);
128 
129  if (next_ == this) return true;
130  linked_ptr_internal const* p = next_;
131  while (p->next_ != this) {
132  assert(p->next_ != next_ &&
133  "Trying to depart() a linked ring we are not in. "
134  "Is GMock thread safety enabled?");
135  p = p->next_;
136  }
137  p->next_ = next_;
138  return false;
139  }
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
bool testing::internal::linked_ptr_internal::depart ( )
inline

Definition at line 125 of file gtest-linked_ptr.h.

References folly::detail::lock(), and next_.

126  {
127  MutexLock lock(&g_linked_ptr_mutex);
128 
129  if (next_ == this) return true;
130  linked_ptr_internal const* p = next_;
131  while (p->next_ != this) {
132  assert(p->next_ != next_ &&
133  "Trying to depart() a linked ring we are not in. "
134  "Is GMock thread safety enabled?");
135  p = p->next_;
136  }
137  p->next_ = next_;
138  return false;
139  }
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
bool testing::internal::linked_ptr_internal::depart ( )
inline

Definition at line 125 of file gtest-linked_ptr.h.

References folly::detail::lock(), and next_.

126  {
127  MutexLock lock(&g_linked_ptr_mutex);
128 
129  if (next_ == this) return true;
130  linked_ptr_internal const* p = next_;
131  while (p->next_ != this) {
132  assert(p->next_ != next_ &&
133  "Trying to depart() a linked ring we are not in. "
134  "Is GMock thread safety enabled?");
135  p = p->next_;
136  }
137  p->next_ = next_;
138  return false;
139  }
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
void testing::internal::linked_ptr_internal::join ( linked_ptr_internal const *  ptr)
inline

Definition at line 108 of file gtest-linked_ptr.h.

References folly::detail::lock(), next_, and ptr.

109  {
110  MutexLock lock(&g_linked_ptr_mutex);
111 
112  linked_ptr_internal const* p = ptr;
113  while (p->next_ != ptr) {
114  assert(p->next_ != this &&
115  "Trying to join() a linked ring we are already in. "
116  "Is GMock thread safety enabled?");
117  p = p->next_;
118  }
119  p->next_ = this;
120  next_ = ptr;
121  }
void * ptr
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
void testing::internal::linked_ptr_internal::join ( linked_ptr_internal const *  ptr)
inline

Definition at line 108 of file gtest-linked_ptr.h.

References folly::detail::lock(), next_, and ptr.

109  {
110  MutexLock lock(&g_linked_ptr_mutex);
111 
112  linked_ptr_internal const* p = ptr;
113  while (p->next_ != ptr) {
114  assert(p->next_ != this &&
115  "Trying to join() a linked ring we are already in. "
116  "Is GMock thread safety enabled?");
117  p = p->next_;
118  }
119  p->next_ = this;
120  next_ = ptr;
121  }
void * ptr
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
void testing::internal::linked_ptr_internal::join ( linked_ptr_internal const *  ptr)
inline

Definition at line 108 of file gtest-linked_ptr.h.

References folly::detail::lock(), next_, and ptr.

Referenced by testing::internal::linked_ptr< const testing::MatcherInterface< const internal::string & > >::copy().

109  {
110  MutexLock lock(&g_linked_ptr_mutex);
111 
112  linked_ptr_internal const* p = ptr;
113  while (p->next_ != ptr) {
114  assert(p->next_ != this &&
115  "Trying to join() a linked ring we are already in. "
116  "Is GMock thread safety enabled?");
117  p = p->next_;
118  }
119  p->next_ = this;
120  next_ = ptr;
121  }
void * ptr
linked_ptr_internal const * next_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
GTestMutexLock MutexLock
Definition: gtest-port.h:2159
void testing::internal::linked_ptr_internal::join_new ( )
inline

Definition at line 92 of file gtest-linked_ptr.h.

References next_.

92  {
93  next_ = this;
94  }
linked_ptr_internal const * next_
void testing::internal::linked_ptr_internal::join_new ( )
inline
void testing::internal::linked_ptr_internal::join_new ( )
inline

Definition at line 92 of file gtest-linked_ptr.h.

References next_.

92  {
93  next_ = this;
94  }
linked_ptr_internal const * next_

Member Data Documentation

linked_ptr_internal const * testing::internal::linked_ptr_internal::next_
mutableprivate

Definition at line 142 of file gtest-linked_ptr.h.

Referenced by depart(), join(), and join_new().


The documentation for this class was generated from the following file: