thread_pool.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_THREAD_POOL_H
#define CPPCMS_THREAD_POOL_H
#include <cppcms/defs.h>
#include <booster/noncopyable.h>
#include <booster/function.h>
#include <booster/hold_ptr.h>
namespace cppcms {
namespace impl {
class thread_pool;
}
class CPPCMS_API thread_pool : public booster::noncopyable {
public:
int post(booster::function<void()> const &job);
bool cancel(int id);
thread_pool(int threads);
void stop();
~thread_pool();
private:
booster::hold_ptr<impl::thread_pool> impl_;
};
} // cppcms
#endif
booster::hold_ptr
a smart pointer similar to std::auto_ptr but it is non-copyable and underlying object has same constn...
Definition: hold_ptr.h:18
cppcms::thread_pool
This class provides an access to the thread pool where all CppCMS synchronous applications are execut...
Definition: thread_pool.h:29
booster::function
Definition: function.h:16
booster::locale::conv::stop
Stop conversion and throw conversion_error.
Definition: encoding_errors.h:56
booster::noncopyable
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15