forked from ambilight-4-mediaportal/AtmoWin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtmoThread.h
More file actions
71 lines (53 loc) · 1.18 KB
/
Copy pathAtmoThread.h
File metadata and controls
71 lines (53 loc) · 1.18 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* AtmoThread.h: Base thread class for all threads inside AtmoWin
*
*
* See the README.txt file for copyright information and how to reach the author(s).
*
* $Id: 1fbcdf03f7ecac1143e9488ba14d2308b232d05b $
*/
#ifndef _AtmoThread_h_
#define _AtmoThread_h_
#include "AtmoDefs.h"
#if defined(_ATMO_VLC_PLUGIN_)
// use threading stuff from videolan!
# include <vlc_common.h>
# include <vlc_threads.h>
#else
# include <windows.h>
#endif
class CThread
{
protected:
#if defined(_ATMO_VLC_PLUGIN_)
vlc_mutex_t m_TerminateLock;
vlc_cond_t m_TerminateCond;
vlc_object_t *m_pOwner;
ATMO_BOOL m_HasThread;
vlc_thread_t m_Thread;
#else
HANDLE m_hThread;
DWORD m_dwThreadID;
HANDLE m_hTerminateEvent;
#endif
volatile ATMO_BOOL m_bTerminated;
private:
#if defined(_ATMO_VLC_PLUGIN_)
static void *ThreadProc(void *);
#else
static DWORD WINAPI ThreadProc(LPVOID lpParameter);
#endif
protected:
virtual DWORD Execute(void);
ATMO_BOOL ThreadSleep(DWORD millisekunden);
public:
#if defined(_ATMO_VLC_PLUGIN_)
CThread(vlc_object_t *pOwner);
#else
CThread(void);
#endif
virtual ~CThread(void);
void Terminate(void);
void Run();
};
#endif