Twitch SDK (Internal)
taskrunner.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
14 #include "twitchsdk/core/thread.h"
15 
16 namespace ttv
17 {
18  class TaskRunner;
19 }
20 
22 {
23 public:
24  TaskRunner();
25  TaskRunner(const std::string& name);
26  ~TaskRunner();
27 
28 public:
29  bool AddTask(std::shared_ptr<Task> task);
30  void PollTasks();
31  void Shutdown();
32 
33 private:
34  void Initialize();
35  void TaskRunnerThreadProc();
36 
37 private:
38  volatile bool mTaskRunnerThreadRunning;
39  std::shared_ptr<IThread> mTaskRunnerThread;
40 
43 
44  std::shared_ptr<IThreadSync> mThreadSync;
45  std::string mName;
46 };
47 
std::string mName
Definition: taskrunner.h:45
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
bool AddTask(std::shared_ptr< Task > task)
ConcurrentQueue< std::shared_ptr< Task > > mDoneTaskQ
Definition: taskrunner.h:42
volatile bool mTaskRunnerThreadRunning
Definition: taskrunner.h:38
std::shared_ptr< IThreadSync > mThreadSync
Definition: taskrunner.h:44
ConcurrentQueue< std::shared_ptr< Task > > mTaskQ
Definition: taskrunner.h:41
std::shared_ptr< IThread > mTaskRunnerThread
Definition: taskrunner.h:39
Definition: concurrentqueue.h:16
Definition: taskrunner.h:21
void TaskRunnerThreadProc()