~ubuntu-branches/ubuntu/wily/libde265/wily

« back to all changes in this revision

Viewing changes to libde265/threads.h

  • Committer: Package Import Robot
  • Author(s): Joachim Bauch
  • Date: 2015-07-16 11:07:46 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150716110746-76vsv24j3yux7tnu
Tags: 1.0.2-1
* Imported Upstream version 1.0.2
* Added new files to copyright information.
* Only export decoder API and update symbols for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#endif
33
33
 
34
34
#include <deque>
 
35
#include <string>
35
36
 
36
37
#ifndef _WIN32
37
38
#include <pthread.h>
43
44
#else // _WIN32
44
45
#include <windows.h>
45
46
#include "../extra/win32cond.h"
 
47
#if _MSC_VER > 1310
46
48
#include <intrin.h>
 
49
#else
 
50
extern "C"
 
51
{
 
52
   LONG  __cdecl _InterlockedExchangeAdd(long volatile *Addend, LONG Value);
 
53
}
 
54
#pragma intrinsic (_InterlockedExchangeAdd)
 
55
#define InterlockedExchangeAdd _InterlockedExchangeAdd
 
56
#endif
47
57
 
48
58
typedef HANDLE              de265_thread;
49
59
typedef HANDLE              de265_mutex;
100
110
 
101
111
  void wait_for_progress(int progress);
102
112
  void set_progress(int progress);
 
113
  void increase_progress(int progress);
103
114
  int  get_progress() const;
104
115
  void reset(int value=0) { mProgress=value; }
105
116
 
123
134
  enum { Queued, Running, Blocked, Finished } state;
124
135
 
125
136
  virtual void work() = 0;
 
137
 
 
138
  virtual std::string name() const { return "noname"; }
126
139
};
127
140
 
128
141