proxygen
FooLongSleep Struct Reference

Public Member Functions

 FooLongSleep (std::atomic< int > &d)
 
 ~FooLongSleep ()
 
void start ()
 

Public Attributes

std::atomic< int > & data
 
folly::ThreadedRepeatingFunctionRunner runner_
 

Detailed Description

Definition at line 40 of file ThreadedRepeatingFunctionRunnerTest.cpp.

Constructor & Destructor Documentation

FooLongSleep::FooLongSleep ( std::atomic< int > &  d)
inlineexplicit

Definition at line 41 of file ThreadedRepeatingFunctionRunnerTest.cpp.

41 : data(d) {}
FooLongSleep::~FooLongSleep ( )
inline

Definition at line 42 of file ThreadedRepeatingFunctionRunnerTest.cpp.

References data.

42  {
43  runner_.stop();
44  data.store(-1);
45  }
folly::ThreadedRepeatingFunctionRunner runner_

Member Function Documentation

void FooLongSleep::start ( )
inline

Definition at line 47 of file ThreadedRepeatingFunctionRunnerTest.cpp.

References data, and h.

Referenced by TEST().

47  {
48  runner_.add("FooLongSleep", [this]() {
49  data.store(1);
50  return 1000h; // Test would time out if we waited
51  });
52  }
*than *hazptr_holder h
Definition: Hazptr.h:116
folly::ThreadedRepeatingFunctionRunner runner_
void add(std::string name, RepeatingFn f, std::chrono::milliseconds initialSleep=std::chrono::milliseconds(0))

Member Data Documentation

std::atomic<int>& FooLongSleep::data

Definition at line 54 of file ThreadedRepeatingFunctionRunnerTest.cpp.

Definition at line 55 of file ThreadedRepeatingFunctionRunnerTest.cpp.


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