Skip to content

Commit 3141ad0

Browse files
author
Herbert KOELMAN
committed
Merge branch 'develop' of mut-mut-scmv1.dev.parimutuel.local:p094212/cpp-pthread into develop
2 parents 2d99b75 + b907596 commit 3141ad0

File tree

9 files changed

+63
-30
lines changed

9 files changed

+63
-30
lines changed

include/pthread/condition_variable.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,21 @@ namespace pthread {
155155
* The pthread_cond_signal() call unblocks at least one of the threads that are blocked
156156
* on the specified condition variable cond (if any threads are blocked on cond).
157157
*/
158-
void notify_one () __NOEXCEPT__;
158+
#if __cplusplus < 201103L
159+
void notify_one () throw() ;
160+
#else
161+
void notify_one () noexcept;
162+
#endif
163+
159164

160165
/** signal all waiting threads
161166
* The pthread_cond_broadcast() call unblocks all threads currently blocked on the specified condition variable cond.
162167
*/
163-
void notify_all () __NOEXCEPT__;
168+
#if __cplusplus < 201103L
169+
void notify_all () throw() ;
170+
#else
171+
void notify_all () noexcept ;
172+
#endif
164173

165174
// constructor/destructor ------------------------------------------------
166175

include/pthread/config.h.in

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
#ifndef pthread_config_h
2626
#define pthread_config_h
2727

28-
#ifdef __IBMCPP__
29-
30-
#else
31-
32-
#endif
33-
3428
#undef CPP_PTHREAD_VERSION
3529

3630
/* Define DEBUG. */
@@ -44,17 +38,6 @@
4438
#undef HAVE_CPP11_CHRONO
4539
#undef HAVE_CPP11_THREAD
4640

47-
/* Define to the address where bug reports for this package should be sent. */
48-
#undef PACKAGE_BUGREPORT
49-
/* Define to the full name of this package. */
50-
#undef PACKAGE_NAME
51-
/* Define to the full name and version of this package. */
52-
#undef PACKAGE_STRING
53-
/* Define to the one symbol short name of this package. */
54-
#undef PACKAGE_TARNAME
55-
/* Define to the version of this package. */
56-
#undef PACKAGE_VERSION
57-
5841
/* Define to empty if `const' does not conform to ANSI C. */
5942
#undef const
6043

include/pthread/pthread_exception.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "pthread/config.h"
1313

1414
#include <errno.h>
15+
#include <cstring>
1516

1617
namespace pthread {
1718

src/condition_variable.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
$Id: condition_variable.C 28 2007-08-06 22:29:28Z hkoelman $
3-
*/
4-
51
#include "pthread/condition_variable.hpp"
62

73
namespace pthread {
@@ -101,11 +97,7 @@ namespace pthread {
10197

10298
// excpetions -------
10399

104-
#ifdef __IBMCPP__
105100
condition_variable_exception::condition_variable_exception( const string message, const int pthread_error): pthread_exception(message, pthread_error){
106-
#else
107-
condition_variable_exception::condition_variable_exception( const string message, const int pthread_error): pthread_exception{message, pthread_error}{
108-
#endif
109101
};
110102

111103

src/configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4156,7 +4156,7 @@ done
41564156
41574157
LDFLAGS="$LDFLAGS $LIBS"
41584158
4159-
ac_config_files="$ac_config_files Makefile"
4159+
ac_config_files="$ac_config_files Makefile pthread.cpp"
41604160
41614161
cat >confcache <<\_ACEOF
41624162
# This file is a shell script that caches the results of configure
@@ -4850,6 +4850,7 @@ do
48504850
case $ac_config_target in
48514851
"../include/pthread/config.h") CONFIG_HEADERS="$CONFIG_HEADERS ../include/pthread/config.h" ;;
48524852
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
4853+
"pthread.cpp") CONFIG_FILES="$CONFIG_FILES pthread.cpp" ;;
48534854
48544855
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
48554856
esac

src/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ AC_CHECK_FUNCS([gettimeofday])
8383

8484
LDFLAGS="$LDFLAGS $LIBS"
8585

86-
AC_CONFIG_FILES([Makefile])
86+
AC_CONFIG_FILES([Makefile pthread.cpp])
8787
AC_OUTPUT
8888

src/pthread.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
#include "pthread/pthread.hpp"
1313
#include "pthread/config.h"
1414

15+
/* Define to the address where bug reports for this package should be sent. */
16+
#undef PACKAGE_BUGREPORT
17+
/* Define to the full name of this package. */
18+
#undef PACKAGE_NAME
19+
/* Define to the full name and version of this package. */
20+
#undef PACKAGE_STRING
21+
/* Define to the one symbol short name of this package. */
22+
#undef PACKAGE_TARNAME
23+
/* Define to the version of this package. */
24+
#undef PACKAGE_VERSION
1525

1626
namespace pthread {
1727

src/pthread.cpp.in

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// cpp_pthread.hpp
3+
// cpp_pthread
4+
//
5+
// Created by herbert koelman on 18/03/2016.
6+
//
7+
//
8+
9+
#ifndef pthread_pthread_hpp
10+
#define pthread_pthread_hpp
11+
12+
#include "pthread/pthread.hpp"
13+
#include "pthread/config.h"
14+
15+
/* Define to the address where bug reports for this package should be sent. */
16+
#undef PACKAGE_BUGREPORT
17+
/* Define to the full name of this package. */
18+
#undef PACKAGE_NAME
19+
/* Define to the full name and version of this package. */
20+
#undef PACKAGE_STRING
21+
/* Define to the one symbol short name of this package. */
22+
#undef PACKAGE_TARNAME
23+
/* Define to the version of this package. */
24+
#undef PACKAGE_VERSION
25+
26+
namespace pthread {
27+
28+
extern "C" const char *cpp_pthread_version(){
29+
#ifndef CPP_PTHREAD_VERSION
30+
return "missing CPP_PTHREAD_VERSION define. Re-run configure" ;
31+
#else
32+
return CPP_PTHREAD_VERSION ;
33+
#endif
34+
}
35+
36+
}
37+
#endif /* pthread_pthread_hpp */

tests/without-cpp11-pthread-tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main(int argc, const char * argv[]) {
7171

7272
std::cout << "version: " << pthread::cpp_pthread_version() << std::endl;
7373

74-
pthread::string dummy;
74+
// std::string dummy;
7575

7676
pthread::thread_group threads(true);
7777
for (auto x = 10 ; x > 0 ; x--){

0 commit comments

Comments
 (0)