Skip to content

Commit 71e4376

Browse files
author
Herbert Koelman
committed
update version infos
handled SONAR issues
1 parent 279dc84 commit 71e4376

17 files changed

+214
-214
lines changed

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for cpp-pthread v1.6.1.
3+
# Generated by GNU Autoconf 2.69 for cpp-pthread v1.7.0.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -579,8 +579,8 @@ MAKEFLAGS=
579579
# Identity of this package.
580580
PACKAGE_NAME='cpp-pthread'
581581
PACKAGE_TARNAME='cpp-pthread'
582-
PACKAGE_VERSION='v1.6.1'
583-
PACKAGE_STRING='cpp-pthread v1.6.1'
582+
PACKAGE_VERSION='v1.7.0'
583+
PACKAGE_STRING='cpp-pthread v1.7.0'
584584
PACKAGE_BUGREPORT='[email protected]'
585585
PACKAGE_URL='http://herbertkoelman.github.io/cpp-pthread/'
586586

@@ -1191,7 +1191,7 @@ if test "$ac_init_help" = "long"; then
11911191
# Omit some internal or obsolete options to make the list less imposing.
11921192
# This message is too long to be a string in the A/UX 3.1 sh.
11931193
cat <<_ACEOF
1194-
\`configure' configures cpp-pthread v1.6.1 to adapt to many kinds of systems.
1194+
\`configure' configures cpp-pthread v1.7.0 to adapt to many kinds of systems.
11951195
11961196
Usage: $0 [OPTION]... [VAR=VALUE]...
11971197
@@ -1255,7 +1255,7 @@ fi
12551255

12561256
if test -n "$ac_init_help"; then
12571257
case $ac_init_help in
1258-
short | recursive ) echo "Configuration of cpp-pthread v1.6.1:";;
1258+
short | recursive ) echo "Configuration of cpp-pthread v1.7.0:";;
12591259
esac
12601260
cat <<\_ACEOF
12611261
@@ -1338,7 +1338,7 @@ fi
13381338
test -n "$ac_init_help" && exit $ac_status
13391339
if $ac_init_version; then
13401340
cat <<\_ACEOF
1341-
cpp-pthread configure v1.6.1
1341+
cpp-pthread configure v1.7.0
13421342
generated by GNU Autoconf 2.69
13431343
13441344
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1355,7 +1355,7 @@ cat >config.log <<_ACEOF
13551355
This file contains any messages produced by compilers while
13561356
running configure, to aid debugging if configure makes a mistake.
13571357
1358-
It was created by cpp-pthread $as_me v1.6.1, which was
1358+
It was created by cpp-pthread $as_me v1.7.0, which was
13591359
generated by GNU Autoconf 2.69. Invocation command line was
13601360
13611361
$ $0 $@
@@ -2681,7 +2681,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
26812681
# report actual input values of CONFIG_FILES etc. instead of their
26822682
# values after options handling.
26832683
ac_log="
2684-
This file was extended by cpp-pthread $as_me v1.6.1, which was
2684+
This file was extended by cpp-pthread $as_me v1.7.0, which was
26852685
generated by GNU Autoconf 2.69. Invocation command line was
26862686
26872687
CONFIG_FILES = $CONFIG_FILES
@@ -2735,7 +2735,7 @@ _ACEOF
27352735
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
27362736
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
27372737
ac_cs_version="\\
2738-
cpp-pthread config.status v1.6.1
2738+
cpp-pthread config.status v1.7.0
27392739
configured by $0, generated by GNU Autoconf 2.69,
27402740
with options \\"\$ac_cs_config\\"
27412741

include/pthread/condition_variable.hpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ namespace pthread {
3434
no_timeout, /*!< unblocked before a timeout occured */
3535
timedout /*!< condition timedout */
3636
};
37-
37+
3838
/** Condition variable.
3939
*
4040
* The condition_variable class is a synchronization primitive that can be used to block a thread, or multiple threads
41-
* at the same time, until another thread both modifies a shared variable (the condition), and notifies the
41+
* at the same time, until another thread both modifies a shared variable (the condition), and notifies the
4242
* condition_variable.
4343
*
4444
* The thread that intends to modify the variable has to
@@ -55,7 +55,7 @@ namespace pthread {
5555
*/
5656
class condition_variable {
5757
public:
58-
58+
5959
/** Wait for condition to be signaled.
6060
*
6161
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
@@ -68,11 +68,11 @@ namespace pthread {
6868
* @see notify_all
6969
*/
7070
void wait ( mutex &mtx );
71-
72-
/** @see wait
71+
72+
/** @see wai
7373
*/
7474
void wait ( lock_guard<pthread::mutex> lck);
75-
75+
7676
/** Wait for condition to be signaled.
7777
*
7878
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
@@ -90,7 +90,7 @@ namespace pthread {
9090
* @see notify_all
9191
*/
9292
template<class Lambda> bool wait( mutex &mtx, Lambda lambda);
93-
93+
9494
/** Wait for condition to be signaled.
9595
*
9696
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
@@ -108,15 +108,15 @@ namespace pthread {
108108
* @see notify_all
109109
*/
110110
template<class Lambda> bool wait( lock_guard<pthread::mutex> &lck, Lambda lambda);
111-
111+
112112
/** Wait for condition to be signaled within given time frame.
113113
*
114114
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
115115
* access by another thread to the mutex and then the condition variable". Call notify_one or notify_all to signal the condition.
116116
*
117117
* Upon successful return, the mutex has been locked and is owned by the calling thread.
118118
*
119-
* If this method is called with millis < 0 then the timeout time is not recalculated. This make it possible to handle spurious
119+
* If this method is called with millis < 0 then the timeout time is not recalculated. This make it possible to handle spurious
120120
* unblocking of condition variable without the need of a lambda expression. The call sequence is then: while(! check_condition() && wait_for(lck, 200) == no_tiemout );
121121
*
122122
* @param mtx ralated mutex, which must be locked by the current thread.
@@ -131,7 +131,7 @@ namespace pthread {
131131
/** @see #wait_for (mutex &, int)
132132
*/
133133
cv_status wait_for (lock_guard<pthread::mutex> &lck, int millis );
134-
134+
135135
/** Wait for condition to be signaled within a given time frame.
136136
*
137137
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
@@ -150,7 +150,7 @@ namespace pthread {
150150
* @see notify_all
151151
*/
152152
template<class Lambda> bool wait_for( mutex &mtx, int millis, Lambda lambda);
153-
153+
154154
/** Wait for condition to be signaled within a given time frame.
155155
*
156156
* This method atomically release mutex and cause the calling thread to block; atomically here means "atomically with respect to
@@ -169,7 +169,7 @@ namespace pthread {
169169
* @see notify_all
170170
*/
171171
template<class Lambda> bool wait_for( lock_guard<pthread::mutex> &lck, int millis, Lambda lambda);
172-
172+
173173
/** Signal one waiting thread.
174174
*
175175
* The call unblocks at least one of the threads that are blocked on the specified condition variable cond (if any threads are blocked on cond).
@@ -179,7 +179,7 @@ namespace pthread {
179179
#else
180180
void notify_one () noexcept;
181181
#endif
182-
182+
183183
/** Signal all waiting threads.
184184
*
185185
* The call unblocks all threads currently blocked on the specified condition variable cond.
@@ -189,32 +189,32 @@ namespace pthread {
189189
#else
190190
void notify_all () noexcept ;
191191
#endif
192-
192+
193193
// constructor/destructor ------------------------------------------------
194-
194+
195195
condition_variable ();
196196
virtual ~condition_variable();
197-
197+
198198
private:
199199
void milliseconds( int milliseconds);
200-
200+
201201
timespec timeout;
202202
pthread_cond_t _condition;
203203
};
204-
204+
205205
/** @} */
206-
206+
207207
// template implementation ----------------------
208-
208+
209209
template<class Lambda> bool condition_variable::wait( mutex &mtx, Lambda lambda){
210-
210+
211211
bool stop_waiting = lambda();
212-
212+
213213
while(!stop_waiting){
214214
wait(mtx);
215215
stop_waiting = lambda(); // handling spurious wakeups
216216
}
217-
217+
218218
return stop_waiting;
219219
};
220220

@@ -223,50 +223,50 @@ namespace pthread {
223223
//return wait( *(lck.mutex()), lambda);
224224
return wait( *(lck._mutex), lambda);
225225
};
226-
226+
227227
template<class Lambda> bool condition_variable::wait_for( mutex &mtx, int millis, Lambda lambda){
228228
int rc = 0;
229229
cv_status status = no_timeout;
230-
231-
milliseconds(millis); // update timeout
230+
231+
milliseconds(millis); // update timeou
232232
bool stop_waiting = lambda(); // returns ​false if the waiting should be continued.
233-
233+
234234
while((! stop_waiting) && (status == no_timeout)){
235-
235+
236236
rc = pthread_cond_timedwait ( &_condition, &mtx._mutex, &timeout );
237-
237+
238238
switch (rc){
239-
239+
240240
case ETIMEDOUT:
241241
status = timedout;
242242
break;
243-
243+
244244
case EINVAL:
245245
throw condition_variable_exception("The value specified by abstime is invalid.", rc); // NOSONAR we use throw instead of return.
246246
break;
247-
247+
248248
case EPERM:
249249
throw condition_variable_exception("The mutex was not owned by the current thread at the time of the call.", rc); // NOSONAR we use throw instead of return.
250250
break;
251251
default:
252252
status = no_timeout ;
253253
break;
254254
}
255-
255+
256256
stop_waiting = lambda();
257257
}
258-
259-
258+
259+
260260
return stop_waiting ; //status == cv_status::no_timeout;
261261
};
262-
262+
263263
template<class Lambda> bool condition_variable::wait_for( lock_guard<pthread::mutex> &lck, int millis, Lambda lambda){
264-
264+
265265
// return wait_for(*(lck.mutex()),millis, lambda);
266266
return wait_for(*(lck._mutex),millis, lambda);
267267
};
268268

269-
269+
270270
} // namespace pthread
271271

272272

include/pthread/config.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
#undef HAVE_CPP11_THREAD
4040

4141
/* Define to empty if `const' does not conform to ANSI C. */
42-
#undef const
42+
#undef cons
4343

4444
/*
4545
* Define to `__inline__' or `__inline' if that's what the C compiler
46-
* calls it, or to nothing if 'inline' is not supported under any name.
46+
* calls it, or to nothing if 'inline' is not supported under any name.
4747
*/
4848
#ifndef __cplusplus
4949
#undef inline

0 commit comments

Comments
 (0)