CppCMS
thread_pool.h
1 //
3 // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
4 //
5 // See accompanying file COPYING.TXT file for licensing details.
6 //
8 #ifndef CPPCMS_THREAD_POOL_H
9 #define CPPCMS_THREAD_POOL_H
10 
11 #include <cppcms/defs.h>
12 #include <booster/noncopyable.h>
13 #include <booster/function.h>
14 #include <booster/hold_ptr.h>
15 
16 namespace cppcms {
17 
18  namespace impl {
19  class thread_pool;
20  }
21 
29  class CPPCMS_API thread_pool : public booster::noncopyable {
30  public:
31 
36  int post(booster::function<void()> const &job);
37 
47  bool cancel(int id);
48 
50  thread_pool(int threads);
51  void stop();
52  ~thread_pool();
54 
55  private:
56 
58  };
59 
60 
61 } // cppcms
62 
63 
64 
65 #endif
66 
a smart pointer similar to std::auto_ptr but it is non-copyable and underlying object has same constn...
Definition: hold_ptr.h:18
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
This class provides an access to the thread pool where all CppCMS synchronous applications are execut...
Definition: thread_pool.h:29
Definition: function.h:16
Stop conversion and throw conversion_error.
Definition: encoding_errors.h:56
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15