summaryrefslogtreecommitdiffstats
path: root/xbmc/interfaces/generic/RunningScriptObserver.h
blob: 2622411a66d9fad252286b157897729935325524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 *  Copyright (C) 2017-2021 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "threads/Event.h"
#include "threads/IRunnable.h"
#include "threads/Thread.h"

#include <atomic>

class CRunningScriptObserver : public IRunnable
{
public:
  CRunningScriptObserver(int scriptId, CEvent& evt);
  ~CRunningScriptObserver();

  void Abort();

protected:
  // implementation of IRunnable
  void Run() override;

  int m_scriptId;
  CEvent& m_event;

  CEvent m_stopEvent;
  CThread m_thread;
};