DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs
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  virtual ~ClosureThread();
37 
38  protected:
40  virtual 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)
virtual void Run() OVERRIDE
SimpleThread implementation overrides.
virtual ~ClosureThread()
The destructor calls Join automatically if it is not yet joined.