BitmapToolkit Scol plugin
include
raspicam
threadcondition.h
Go to the documentation of this file.
1
/**********************************************************
2
Software developed by AVA ( Ava Group of the University of Cordoba, ava at uco dot es)
3
Main author Rafael Munoz Salinas (rmsalinas at uco dot es)
4
This software is released under BSD license as expressed below
5
-------------------------------------------------------------------
6
Copyright (c) 2013, AVA ( Ava Group University of Cordoba, ava at uco dot es)
7
All rights reserved.
8
9
Redistribution and use in source and binary forms, with or without
10
modification, are permitted provided that the following conditions
11
are met:
12
1. Redistributions of source code must retain the above copyright
13
notice, this list of conditions and the following disclaimer.
14
2. Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in the
16
documentation and/or other materials provided with the distribution.
17
3. All advertising materials mentioning features or use of this software
18
must display the following acknowledgement:
19
20
This product includes software developed by the Ava group of the University of Cordoba.
21
22
4. Neither the name of the University nor the names of its contributors
23
may be used to endorse or promote products derived from this software
24
without specific prior written permission.
25
26
THIS SOFTWARE IS PROVIDED BY AVA ''AS IS'' AND ANY
27
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
DISCLAIMED. IN NO EVENT SHALL AVA BE LIABLE FOR ANY
30
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
33
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
****************************************************************/
37
38
39
40
#ifndef _RASPICAM_THREADTHREADCONDITION_H
41
#define _RASPICAM_THREADTHREADCONDITION_H
42
#include <string>
43
#include <thread>
// std::thread
44
#include <mutex>
// std::mutex, std::unique_lock
45
#include <condition_variable>
// std::condition_variable
46
47
#include "
exceptions.h
"
48
namespace
raspicam
{
49
namespace
_private
50
{
54
class
ThreadCondition
55
{
56
public
:
57
ThreadCondition
()
throw
(
raspicam::Exception
);
58
60
void
Wait
(std::unique_lock<std::mutex>& lck)
throw
(
raspicam::Exception
);
61
62
64
void
BroadCast
()
throw
(
raspicam::Exception
);
65
66
private
:
67
std::mutex mtx;
68
std::condition_variable
cv
;
69
bool
ready ;
70
71
};
72
}
73
}
/* ----- end of namespace gu ----- */
74
#endif
raspicam::_private::ThreadCondition
This class implements a condition to stop a thread until the condition is reached.
Definition
threadcondition.h:55
raspicam::_private::ThreadCondition::ThreadCondition
ThreadCondition()
Definition
threadcondition.cpp:48
raspicam::_private::ThreadCondition::Wait
void Wait(std::unique_lock< std::mutex > &lck)
Definition
threadcondition.cpp:56
raspicam::_private::ThreadCondition::BroadCast
void BroadCast()
Definition
threadcondition.cpp:65
raspicam::Exception
Definition
exceptions.h:60
exceptions.h
cv
Definition
freetypeFont.h:50
raspicam
Definition
exceptions.h:43
Generated by
1.9.8