Skip to content

Commit 93a31fe

Browse files
author
Herbert Koelman
committed
Merge tag 'v1.6.0'
release v1.6.0
2 parents 2b66030 + 2f703e3 commit 93a31fe

28 files changed

+1064
-599
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ core
2828
*.exe
2929
*.out
3030
*.app
31-
exceptions-tests
32-
without-cpp11-pthread-tests
33-
with-cpp11-pthread-tests
31+
tests/*tests
3432

3533
# emacs
3634
*~
@@ -51,11 +49,12 @@ config.h
5149
autom4te.cache
5250
config.status
5351
config.log
54-
#configure
5552
Makefile
5653

5754
# layout
5855
doxyfile
56+
*.tar
57+
sonar-project.properties
5958
distrib/
6059
lib/
6160
doc/

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ pkg:
2727
tar cf - `git ls-files` | gzip -c > distrib/$(PACKAGE)
2828

2929
globber:clean
30-
-$(RM) -R Makefile autom4te.cache config.log config.status
30+
-$(RM) -R Makefile autom4te.cache config.log config.status doxyfile sonar-project.properties
3131

3232
clean:
3333
-(cd src && $(MAKE) clean)
3434

35-
codecheck: clean all
35+
codecheck: all
3636
$(CODECHECK)
3737

3838
version:

configure

Lines changed: 17 additions & 16 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.4.0.
3+
# Generated by GNU Autoconf 2.69 for cpp-pthread v1.6.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.4.0'
583-
PACKAGE_STRING='cpp-pthread v1.4.0'
582+
PACKAGE_VERSION='v1.6.0'
583+
PACKAGE_STRING='cpp-pthread v1.6.0'
584584
PACKAGE_BUGREPORT='[email protected]'
585585
PACKAGE_URL='http://herbertkoelman.github.io/cpp-pthread/'
586586

@@ -1187,7 +1187,7 @@ if test "$ac_init_help" = "long"; then
11871187
# Omit some internal or obsolete options to make the list less imposing.
11881188
# This message is too long to be a string in the A/UX 3.1 sh.
11891189
cat <<_ACEOF
1190-
\`configure' configures cpp-pthread v1.4.0 to adapt to many kinds of systems.
1190+
\`configure' configures cpp-pthread v1.6.0 to adapt to many kinds of systems.
11911191
11921192
Usage: $0 [OPTION]... [VAR=VALUE]...
11931193
@@ -1251,7 +1251,7 @@ fi
12511251

12521252
if test -n "$ac_init_help"; then
12531253
case $ac_init_help in
1254-
short | recursive ) echo "Configuration of cpp-pthread v1.4.0:";;
1254+
short | recursive ) echo "Configuration of cpp-pthread v1.6.0:";;
12551255
esac
12561256
cat <<\_ACEOF
12571257
@@ -1332,7 +1332,7 @@ fi
13321332
test -n "$ac_init_help" && exit $ac_status
13331333
if $ac_init_version; then
13341334
cat <<\_ACEOF
1335-
cpp-pthread configure v1.4.0
1335+
cpp-pthread configure v1.6.0
13361336
generated by GNU Autoconf 2.69
13371337
13381338
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1349,7 +1349,7 @@ cat >config.log <<_ACEOF
13491349
This file contains any messages produced by compilers while
13501350
running configure, to aid debugging if configure makes a mistake.
13511351
1352-
It was created by cpp-pthread $as_me v1.4.0, which was
1352+
It was created by cpp-pthread $as_me v1.6.0, which was
13531353
generated by GNU Autoconf 2.69. Invocation command line was
13541354
13551355
$ $0 $@
@@ -1995,8 +1995,8 @@ $as_echo "$MKDIR_P" >&6; }
19951995
# Okay, no cppcheck found, maybe we have sonar
19961996
if test -z "$CODECHECK"
19971997
then
1998-
# Extract the first word of "cppcheck", so it can be a program name with args.
1999-
set dummy cppcheck; ac_word=$2
1998+
# Extract the first word of "sonar-runner", so it can be a program name with args.
1999+
set dummy sonar-runner; ac_word=$2
20002000
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
20012001
$as_echo_n "checking for $ac_word... " >&6; }
20022002
if ${ac_cv_prog_CODECHECK+:} false; then :
@@ -2012,7 +2012,7 @@ do
20122012
test -z "$as_dir" && as_dir=.
20132013
for ac_exec_ext in '' $ac_executable_extensions; do
20142014
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2015-
ac_cv_prog_CODECHECK="cppcheck --template='{file}:{line},{severity},{id}:\n {message}\n' --enable=all -I ../include ./"
2015+
ac_cv_prog_CODECHECK="sonar-runner -Dsonar.cfamily.library.directories=./include,/usr/include"
20162016
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
20172017
break 2
20182018
fi
@@ -2037,8 +2037,8 @@ fi
20372037
# Okay, no cppcheck found, maybe we have sonar
20382038
if test -z "$CODECHECK"
20392039
then
2040-
# Extract the first word of "sonar-runner", so it can be a program name with args.
2041-
set dummy sonar-runner; ac_word=$2
2040+
# Extract the first word of "cppcheck", so it can be a program name with args.
2041+
set dummy cppcheck; ac_word=$2
20422042
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
20432043
$as_echo_n "checking for $ac_word... " >&6; }
20442044
if ${ac_cv_prog_CODECHECK+:} false; then :
@@ -2054,7 +2054,7 @@ do
20542054
test -z "$as_dir" && as_dir=.
20552055
for ac_exec_ext in '' $ac_executable_extensions; do
20562056
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2057-
ac_cv_prog_CODECHECK="sonar-runner -Dsonar.cfamily.library.directories=../include,/usr/include,$IMSDIR/include,$TUXDIR/include"
2057+
ac_cv_prog_CODECHECK="cppcheck --template='{file}:{line},{severity},{id}:\n {message}\n' --enable=all -I ./include ./src ./include"
20582058
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
20592059
break 2
20602060
fi
@@ -2099,7 +2099,7 @@ HEADERS=$HEADERS
20992099
21002100
subdirs="$subdirs src"
21012101
2102-
ac_config_files="$ac_config_files Makefile doxyfile"
2102+
ac_config_files="$ac_config_files Makefile doxyfile sonar-project.properties"
21032103
21042104
cat >confcache <<\_ACEOF
21052105
# This file is a shell script that caches the results of configure
@@ -2643,7 +2643,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
26432643
# report actual input values of CONFIG_FILES etc. instead of their
26442644
# values after options handling.
26452645
ac_log="
2646-
This file was extended by cpp-pthread $as_me v1.4.0, which was
2646+
This file was extended by cpp-pthread $as_me v1.6.0, which was
26472647
generated by GNU Autoconf 2.69. Invocation command line was
26482648
26492649
CONFIG_FILES = $CONFIG_FILES
@@ -2697,7 +2697,7 @@ _ACEOF
26972697
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
26982698
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
26992699
ac_cs_version="\\
2700-
cpp-pthread config.status v1.4.0
2700+
cpp-pthread config.status v1.6.0
27012701
configured by $0, generated by GNU Autoconf 2.69,
27022702
with options \\"\$ac_cs_config\\"
27032703
@@ -2811,6 +2811,7 @@ do
28112811
case $ac_config_target in
28122812
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
28132813
"doxyfile") CONFIG_FILES="$CONFIG_FILES doxyfile" ;;
2814+
"sonar-project.properties") CONFIG_FILES="$CONFIG_FILES sonar-project.properties" ;;
28142815
28152816
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
28162817
esac

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ AC_PROG_MKDIR_P
2222
# Okay, no cppcheck found, maybe we have sonar
2323
if test -z "$CODECHECK"
2424
then
25-
AC_CHECK_PROG([CODECHECK],[cppcheck],[cppcheck --template='{file}:{line},{severity},{id}:\n {message}\n' --enable=all -I ../include ./],[])
25+
AC_CHECK_PROG([CODECHECK],[sonar-runner],[sonar-runner -Dsonar.cfamily.library.directories=./include,/usr/include],[])
2626
fi
2727

2828
# Okay, no cppcheck found, maybe we have sonar
2929
if test -z "$CODECHECK"
3030
then
31-
AC_CHECK_PROG([CODECHECK],[sonar-runner],[sonar-runner -Dsonar.cfamily.library.directories=../include,/usr/include,$IMSDIR/include,$TUXDIR/include],[])
31+
AC_CHECK_PROG([CODECHECK],[cppcheck],[cppcheck --template='{file}:{line},{severity},{id}:\n {message}\n' --enable=all -I ./include ./src ./include],[])
3232
fi
3333

3434
AC_MSG_CHECKING([whether target directory ./lib exists])
@@ -47,6 +47,6 @@ done
4747
AC_SUBST(HEADERS,$HEADERS)
4848

4949
AC_CONFIG_SUBDIRS(src)
50-
AC_CONFIG_FILES([Makefile doxyfile])
50+
AC_CONFIG_FILES([Makefile doxyfile sonar-project.properties])
5151
AC_OUTPUT
5252

doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ USE_MDFILE_AS_MAINPAGE =README.md
991991
# also VERBATIM_HEADERS is set to NO.
992992
# The default value is: NO.
993993

994-
SOURCE_BROWSER = NO
994+
SOURCE_BROWSER = YES
995995

996996
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
997997
# classes and enums directly into the documentation.

include/pthread/condition_variable.hpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// recommandation for more info p.285 §8.3.1).
1111
#include <pthread.h>
1212
#include <string>
13-
#include <time.h>
13+
#include <ctime>
1414
#include <sys/time.h>
1515

1616
#include "pthread/config.h"
@@ -20,7 +20,15 @@
2020
#include "pthread/lock_guard.hpp"
2121

2222
namespace pthread {
23-
23+
24+
/** \addtogroup concurrency Concurrency
25+
*
26+
* Set of classes to handle concurrent access to shared ressources.
27+
*
28+
* @author herbert koelman ([email protected])
29+
* @{
30+
*/
31+
2432
/** condition variable current wait status. */
2533
enum cv_status {
2634
no_timeout, /*!< unblocked before a timeout occured */
@@ -43,7 +51,7 @@ namespace pthread {
4351
*
4452
* Upon successful return, the mutex shall have been locked and shall be owned by the calling thread.
4553
*
46-
* @author herbert koelman
54+
* @author herbert koelman ([email protected])
4755
*/
4856
class condition_variable {
4957
public:
@@ -194,6 +202,8 @@ namespace pthread {
194202
pthread_cond_t _condition;
195203
};
196204

205+
/** @} */
206+
197207
// template implementation ----------------------
198208

199209
template<class Lambda> bool condition_variable::wait( mutex &mtx, Lambda lambda){
@@ -221,7 +231,7 @@ namespace pthread {
221231
milliseconds(millis); // update timeout
222232
bool stop_waiting = lambda(); // returns ​false if the waiting should be continued.
223233

224-
while(! stop_waiting && status == no_timeout){
234+
while((! stop_waiting) && (status == no_timeout)){
225235

226236
rc = pthread_cond_timedwait ( &_condition, &mtx._mutex, &timeout );
227237

@@ -232,11 +242,11 @@ namespace pthread {
232242
break;
233243

234244
case EINVAL:
235-
throw condition_variable_exception("The value specified by abstime is invalid.", rc);
245+
throw condition_variable_exception("The value specified by abstime is invalid.", rc); // NOSONAR we use throw instead of return.
236246
break;
237247

238248
case EPERM:
239-
throw condition_variable_exception("The mutex was not owned by the current thread at the time of the call.", rc);
249+
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.
240250
break;
241251
default:
242252
status = no_timeout ;
@@ -255,6 +265,9 @@ namespace pthread {
255265
// return wait_for(*(lck.mutex()),millis, lambda);
256266
return wait_for(*(lck._mutex),millis, lambda);
257267
};
268+
258269

259270
} // namespace pthread
271+
272+
260273
#endif

0 commit comments

Comments
 (0)