| 42 | int SlowConstructor::constructed = 0; |
| 43 | |
| 44 | class SlowDelegate : public butil::DelegateSimpleThread::Delegate { |
| 45 | public: |
| 46 | explicit SlowDelegate(butil::LazyInstance<SlowConstructor>* lazy) |
| 47 | : lazy_(lazy) {} |
| 48 | |
| 49 | virtual void Run() OVERRIDE { |
| 50 | EXPECT_EQ(12, lazy_->Get().some_int()); |
| 51 | EXPECT_EQ(12, lazy_->Pointer()->some_int()); |
| 52 | } |
| 53 | |
| 54 | private: |
| 55 | butil::LazyInstance<SlowConstructor>* lazy_; |
| 56 | }; |
| 57 | |
| 58 | } // namespace |
| 59 |