diff options
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/Cond.hxx | 4 | ||||
-rw-r--r-- | src/thread/Id.hxx | 2 | ||||
-rw-r--r-- | src/thread/Mutex.hxx | 4 | ||||
-rw-r--r-- | src/thread/Name.hxx | 2 | ||||
-rw-r--r-- | src/thread/PosixCond.hxx | 16 | ||||
-rw-r--r-- | src/thread/PosixMutex.hxx | 16 | ||||
-rw-r--r-- | src/thread/Slack.hxx | 2 | ||||
-rw-r--r-- | src/thread/Thread.cxx | 2 | ||||
-rw-r--r-- | src/thread/Thread.hxx | 2 |
9 files changed, 23 insertions, 27 deletions
diff --git a/src/thread/Cond.hxx b/src/thread/Cond.hxx index a05d1c67d..ed016d212 100644 --- a/src/thread/Cond.hxx +++ b/src/thread/Cond.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 Max Kellermann <max@duempel.org> + * Copyright (C) 2009-2015 Max Kellermann <max@duempel.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,8 +32,6 @@ #ifdef WIN32 -/* mingw-w64 4.6.3 lacks a std::cond implementation */ - #include "WindowsCond.hxx" class Cond : public WindowsCond {}; diff --git a/src/thread/Id.hxx b/src/thread/Id.hxx index 11be0a56b..60006e31a 100644 --- a/src/thread/Id.hxx +++ b/src/thread/Id.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/thread/Mutex.hxx b/src/thread/Mutex.hxx index c17538549..bc4deebdd 100644 --- a/src/thread/Mutex.hxx +++ b/src/thread/Mutex.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 Max Kellermann <max@duempel.org> + * Copyright (C) 2009-2015 Max Kellermann <max@duempel.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,8 +32,6 @@ #ifdef WIN32 -/* mingw-w64 4.6.3 lacks a std::mutex implementation */ - #include "CriticalSection.hxx" class Mutex : public CriticalSection {}; diff --git a/src/thread/Name.hxx b/src/thread/Name.hxx index a99208dab..999cebf73 100644 --- a/src/thread/Name.hxx +++ b/src/thread/Name.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/thread/PosixCond.hxx b/src/thread/PosixCond.hxx index b3fe204e1..73dbe0218 100644 --- a/src/thread/PosixCond.hxx +++ b/src/thread/PosixCond.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 Max Kellermann <max@duempel.org> + * Copyright (C) 2009-2015 Max Kellermann <max@duempel.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,9 +41,13 @@ class PosixCond { pthread_cond_t cond; public: -#if defined(__NetBSD__) || defined(__BIONIC__) - /* NetBSD's PTHREAD_COND_INITIALIZER is not compatible with - "constexpr" */ +#ifdef __GLIBC__ + /* optimized constexpr constructor for pthread implementations + that support it */ + constexpr PosixCond():cond(PTHREAD_COND_INITIALIZER) {} +#else + /* slow fallback for pthread implementations that are not + compatible with "constexpr" */ PosixCond() { pthread_cond_init(&cond, nullptr); } @@ -51,10 +55,6 @@ public: ~PosixCond() { pthread_cond_destroy(&cond); } -#else - /* optimized constexpr constructor for sane POSIX - implementations */ - constexpr PosixCond():cond(PTHREAD_COND_INITIALIZER) {} #endif PosixCond(const PosixCond &other) = delete; diff --git a/src/thread/PosixMutex.hxx b/src/thread/PosixMutex.hxx index 5805158d5..e0fd614c8 100644 --- a/src/thread/PosixMutex.hxx +++ b/src/thread/PosixMutex.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 Max Kellermann <max@duempel.org> + * Copyright (C) 2009-2015 Max Kellermann <max@duempel.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,9 +41,13 @@ class PosixMutex { pthread_mutex_t mutex; public: -#if defined(__NetBSD__) || defined(__BIONIC__) - /* NetBSD's PTHREAD_MUTEX_INITIALIZER is not compatible with - "constexpr" */ +#ifdef __GLIBC__ + /* optimized constexpr constructor for pthread implementations + that support it */ + constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {} +#else + /* slow fallback for pthread implementations that are not + compatible with "constexpr" */ PosixMutex() { pthread_mutex_init(&mutex, nullptr); } @@ -51,10 +55,6 @@ public: ~PosixMutex() { pthread_mutex_destroy(&mutex); } -#else - /* optimized constexpr constructor for sane POSIX - implementations */ - constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {} #endif PosixMutex(const PosixMutex &other) = delete; diff --git a/src/thread/Slack.hxx b/src/thread/Slack.hxx index 66b2254a4..3f9c71d52 100644 --- a/src/thread/Slack.hxx +++ b/src/thread/Slack.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/thread/Thread.cxx b/src/thread/Thread.cxx index 2932d478f..78675d84e 100644 --- a/src/thread/Thread.cxx +++ b/src/thread/Thread.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify diff --git a/src/thread/Thread.hxx b/src/thread/Thread.hxx index 976ff5625..668f5e9f7 100644 --- a/src/thread/Thread.hxx +++ b/src/thread/Thread.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2014 The Music Player Daemon Project + * Copyright (C) 2003-2015 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify |