DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
closure_thread.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_BASE_CLOSURE_THREAD_H_
8 #define MEDIA_BASE_CLOSURE_THREAD_H_
9 
10 #include "packager/base/callback.h"
11 #include "packager/base/threading/simple_thread.h"
12 
13 namespace edash_packager {
14 namespace media {
15 
25 class ClosureThread : public base::SimpleThread {
26  public:
32  explicit ClosureThread(const std::string& name_prefix,
33  const base::Closure& task);
34 
36  ~ClosureThread() override;
37 
38  protected:
40  void Run() override;
41 
42  private:
43  const base::Closure task_;
44 };
45 
46 } // namespace media
47 } // namespace edash_packager
48 
49 #endif // MEDIA_BASE_CLOSURE_THREAD_H_
ClosureThread(const std::string &name_prefix, const base::Closure &task)
~ClosureThread() override
The destructor calls Join automatically if it is not yet joined.
void Run() override
SimpleThread implementation overrides.