Magick++ 7.1.2-32
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
Thread.h
1// This may look like C code, but it is really -*- C++ -*-
2//
3// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003
4//
5// Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6// dedicated to making software imaging solutions freely available.
7//
8// Definition of types and classes to support threads
9//
10// This class is a Magick++ implementation class and is not intended
11// for use by end-users.
12//
13#if !defined (Magick_Thread_header)
14#define Magick_Thread_header
15
16#include "Magick++/Include.h"
17
18#if defined(_VISUALC_)
19#include <windows.h>
20#endif // defined(_VISUALC_)
21
22#if defined(MAGICKCORE_HAVE_PTHREAD)
23# include <pthread.h>
24#endif // defined(MAGICKCORE_HAVE_PTHREAD)
25
26#include <mutex>
27
28namespace Magick
29{
30 // Mutex lock wrapper
31 class MagickPPExport MutexLock
32 {
33 public:
34
35 // Default constructor
36 MutexLock(void);
37
38 // Destructor
39 ~MutexLock(void);
40
41 // Lock mutex
42 void lock(void);
43
44 // Unlock mutex
45 void unlock(void);
46
47 private:
48
49 // Don't support copy constructor
50 MutexLock(const MutexLock& original_);
51
52 // Don't support assignment
53 MutexLock& operator=(const MutexLock& original );
54
55#if defined(MAGICKCORE_HAVE_PTHREAD)
56 pthread_mutex_t _mutex;
57#endif
58#if defined(_MT) && defined(_VISUALC_)
59 HANDLE _mutex;
60#endif
61 };
62}
63
64#endif // Magick_Thread_header