|
Scroom 0.14-49-gb7ae7a6d
|
#include <iostream>#include <memory>#include <boost/date_time/posix_time/posix_time.hpp>#include <boost/thread.hpp>#include <gtest/gtest.h>#include <scroom/semaphore.hh>#include <scroom/threadpool.hh>#include "helpers.hh"
Functions | |
| const millisec | short_timeout (250) |
| const millisec | long_timeout (2000) |
| t | schedule (clear(&s), weak) |
| t | add () |
| EXPECT_TRUE (s.P(long_timeout)) | |
| queue | reset () |
| t | schedule (clear(&s2)) |
| EXPECT_TRUE (s2.P(long_timeout)) | |
| EXPECT_FALSE (s1.try_P()) | |
Variables | |
| ThreadPool::WeakQueue::Ptr const | weak = queue->getWeak() |
| Semaphore | s (0) |
| ThreadPool | t (0) |
| Semaphore | s1 (0) |
| Semaphore | s2 (0) |
| t add | ( | ) |
| EXPECT_FALSE | ( | s1. | try_P() | ) |
| EXPECT_TRUE | ( | s. | Plong_timeout | ) |
| EXPECT_TRUE | ( | s2. | Plong_timeout | ) |
| const millisec long_timeout | ( | 2000 | ) |
| queue reset | ( | ) |
| const millisec short_timeout | ( | 250 | ) |
| Semaphore s(0) | ( | 0 | ) |
| Semaphore s1(0) | ( | 0 | ) |
| Semaphore s2(0) | ( | 0 | ) |
| ThreadPool t(0) | ( | 0 | ) |
| ThreadPool::WeakQueue::Ptr const weak = queue->getWeak() |
Referenced by ThreadPool::Queue::get(), ThreadPool::Queue::getWeak(), and ThreadPool::Queue::~Queue().