|
Scroom 0.14-48-ga0fee447
|
#include <iostream>#include <memory>#include <boost/date_time/posix_time/posix_time.hpp>#include <boost/thread.hpp>#include <gtest/gtest.h>#include <scroom/function-additor.hh>#include <scroom/semaphore.hh>#include "helpers.hh"#include "queue.hh"
Functions | |
| static const millisec | short_timeout (250) |
| static const millisec | long_timeout (2000) |
| EXPECT_TRUE (queue !=nullptr) | |
| EXPECT_EQ (0, queue->getCount()) | |
| queue | jobStarted () |
| EXPECT_EQ (1, queue->getCount()) | |
| EXPECT_EQ (2, queue->getCount()) | |
| queue | jobFinished () |
| EXPECT_TRUE (qi !=nullptr) | |
| EXPECT_EQ (0, qi->getCount()) | |
| EXPECT_EQ (1, qi->getCount()) | |
| EXPECT_EQ (2, qi->getCount()) | |
| boost::thread const | t (pass(&s1)+destroy(queue)+clear(&s2)) |
| queue | reset () |
| EXPECT_TRUE (weakQueue.lock() !=nullptr) | |
| s1 | V () |
| EXPECT_FALSE (s2.P(long_timeout)) | |
| EXPECT_FALSE (weakQueue.lock() !=nullptr) | |
| EXPECT_FALSE (s2.P(short_timeout)) | |
| EXPECT_TRUE (s2.P(long_timeout)) | |
| boost::thread const | t (clear(&s0)+pass(&s1)+destroy(queue)+clear(&s2)) |
| s0 | P () |
| t | schedule (clear(&s), queue) |
| t | add () |
| EXPECT_TRUE (s.P(long_timeout)) | |
| t | schedule (clear(&s2)) |
| EXPECT_FALSE (s1.try_P()) | |
| pool | schedule (clear(&s1)+pass(&s2), queue) |
| EXPECT_TRUE (s1.P(long_timeout)) | |
| boost::thread const | t (pass(&s3)+destroy(queue)+clear(&s4)) |
| EXPECT_FALSE (s4.P(long_timeout)) | |
| EXPECT_TRUE (s4.P(long_timeout)) | |
Variables | |
| ThreadPool::Queue::WeakPtr const | weakQueue = queue |
| QueueImpl::Ptr const | qi = queue->get() |
| Semaphore | s1 (0) |
| Semaphore | s2 (0) |
| auto * | l = new QueueLock(queue->get()) |
| Semaphore | s0 (0) |
| Semaphore | s (0) |
| ThreadPool | t (0) |
| Semaphore | s3 (0) |
| Semaphore | s4 (0) |
| ThreadPool | pool (0) |
| pool add | ( | ) |
Referenced by Scroom::Bookkeeping::Detail::TokenAddition::operator+(), Scroom::Bookkeeping::Detail::TokenAddition::operator+=(), and Scroom::Bookkeeping::Token::operator+=().

| EXPECT_EQ | ( | 0 | , |
| qi-> | getCount() | ||
| ) |
| EXPECT_EQ | ( | 0 | , |
| queue-> | getCount() | ||
| ) |
| EXPECT_EQ | ( | 1 | , |
| qi-> | getCount() | ||
| ) |
| EXPECT_EQ | ( | 1 | , |
| queue-> | getCount() | ||
| ) |
| EXPECT_EQ | ( | 2 | , |
| qi-> | getCount() | ||
| ) |
| EXPECT_EQ | ( | 2 | , |
| queue-> | getCount() | ||
| ) |
| EXPECT_FALSE | ( | s1. | try_P() | ) |
| EXPECT_FALSE | ( | s2. | Plong_timeout | ) |
| EXPECT_FALSE | ( | s2. | Pshort_timeout | ) |
| EXPECT_FALSE | ( | s4. | Plong_timeout | ) |
| EXPECT_FALSE | ( | weakQueue.lock() ! | = nullptr | ) |
| EXPECT_TRUE | ( | qi ! | = nullptr | ) |
| EXPECT_TRUE | ( | queue ! | = nullptr | ) |
| EXPECT_TRUE | ( | s. | Plong_timeout | ) |
| EXPECT_TRUE | ( | s1. | Plong_timeout | ) |
| EXPECT_TRUE | ( | s2. | Plong_timeout | ) |
| EXPECT_TRUE | ( | s4. | Plong_timeout | ) |
| EXPECT_TRUE | ( | weakQueue.lock() ! | = nullptr | ) |
| qi jobFinished | ( | ) |
| qi jobStarted | ( | ) |
|
static |
| s0 P | ( | ) |
| queue reset | ( | ) |
|
static |
| s1 V | ( | ) |
| delete l = new QueueLock(queue->get()) |
| ThreadPool pool | ( | 0 | ) |
| QueueImpl::Ptr const qi = queue->get() |
Referenced by ThreadPool::WeakQueue::get().
| Semaphore s(0) | ( | 0 | ) |
| Semaphore s0(0) | ( | 0 | ) |
| Semaphore s1(0) | ( | 0 | ) |
| Semaphore s2(0) | ( | 0 | ) |
| Scaffold s3 | ( | 0 | ) |
| Scaffold s4 | ( | 0 | ) |
| ThreadPool t | ( | 0 | ) |
Referenced by ThreadPool::add(), anonymous_namespace{threadpoolimpl.cc}::ThreadList::add(), anonymous_namespace{threadpoolimpl.cc}::ThreadList::add(), Scroom::GtkHelpers::async_on_ui_thread_and_wait(), CompressedTile::getState(), if(), anonymous_namespace{threadpoolimpl.cc}::NotifyThreadList(), on_view_created(), anonymous_namespace{tiledbitmappresentation.cc}::OpenTiledBitmapAsPresentation::open(), TiledBitmap::redraw(), Layer::registerObserver(), Scroom::Utils::Observable< T >::registerObserver(), Scroom::Utils::Observable< T >::registerStrongObserver(), Scroom::Bookkeeping::MapBase< K, V >::remove(), CompressedTile::reportFinished(), Scroom::Bookkeeping::MapBase< K, V >::reReserve(), Scroom::Bookkeeping::MapBase< K, V >::reserve(), ThreadPool::schedule(), and ThreadPool::schedule().
| ThreadPool::Queue::WeakPtr const weakQueue = queue |
Referenced by Scroom::TiledBitmap::scheduleLoadingBitmap().