proxygen
GlobalLockPQ< T > Class Template Reference

Public Member Functions

void push (const T &val)
 
void pop (T &val)
 

Private Attributes

std::priority_queue< Tq_
 
std::mutex m_
 

Detailed Description

template<typename T>
class GlobalLockPQ< T >

Definition at line 845 of file RelaxedConcurrentPriorityQueueTest.cpp.

Member Function Documentation

template<typename T >
void GlobalLockPQ< T >::pop ( T val)
inline

Definition at line 854 of file RelaxedConcurrentPriorityQueueTest.cpp.

References g().

854  {
855  while (true) {
856  std::lock_guard<std::mutex> g(m_);
857  if (q_.empty()) {
858  continue;
859  }
860  val = q_.top();
861  q_.pop();
862  return;
863  }
864  }
double val
Definition: String.cpp:273
std::priority_queue< T > q_
g_t g(f_t)
template<typename T >
void GlobalLockPQ< T >::push ( const T val)
inline

Definition at line 850 of file RelaxedConcurrentPriorityQueueTest.cpp.

References g().

850  {
851  std::lock_guard<std::mutex> g(m_);
852  q_.push(val);
853  }
double val
Definition: String.cpp:273
std::priority_queue< T > q_
g_t g(f_t)

Member Data Documentation

template<typename T >
std::mutex GlobalLockPQ< T >::m_
private

Definition at line 847 of file RelaxedConcurrentPriorityQueueTest.cpp.

template<typename T >
std::priority_queue<T> GlobalLockPQ< T >::q_
private

Definition at line 846 of file RelaxedConcurrentPriorityQueueTest.cpp.


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