Theora Playback Library  1.0.0
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TheoraAsync.h
Go to the documentation of this file.
1 /************************************************************************************
2 This source file is part of the Theora Video Playback Library
3 For latest info, see http://libtheoraplayer.sourceforge.net/
4 *************************************************************************************
5 Copyright (c) 2008-2013 Kresimir Spes (kspes@cateia.com)
6 This program is free software; you can redistribute it and/or modify it under
7 the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php
8 *************************************************************************************/
9 #ifndef _TheoraAsync_h
10 #define _TheoraAsync_h
11 
12 #ifndef _WIN32
13 #include <pthread.h>
14 #endif
15 
20 {
21 protected:
22 #ifdef _WIN32
23  void* mHandle;
24 #else
25  pthread_mutex_t mHandle;
26 #endif
27 public:
28  TheoraMutex();
29  ~TheoraMutex();
31  void lock();
33  void unlock();
34 };
35 
40 {
41 protected:
42 #ifdef _WIN32
43  void* mHandle;
44 #else
45  pthread_t mHandle;
46 #endif
47 
48  volatile bool mThreadRunning;
49 public:
50  TheoraThread();
51  virtual ~TheoraThread();
52 
54  void startThread();
56  virtual void executeThread()=0;
58  void waitforThread();
59 
60 };
61 
62 #endif