diff -r 9266b55758bb -r 7ec78a34de32 boost/config/posix_features.hpp
a
|
b
|
|
77 | 77 | // Likewise for the functions log1p and expm1. |
78 | 78 | # if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500) |
79 | 79 | # define BOOST_HAS_GETTIMEOFDAY |
80 | | # if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500) |
| 80 | # if (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)) || defined(__ANDROID__) |
81 | 81 | # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE |
82 | 82 | # endif |
83 | 83 | # ifndef BOOST_HAS_LOG1P |
diff -r 9266b55758bb -r 7ec78a34de32 boost/thread/pthread/mutex.hpp
a
|
b
|
|
26 | 26 | #endif |
27 | 27 | #include <boost/thread/detail/delete.hpp> |
28 | 28 | |
29 | | #ifdef _POSIX_TIMEOUTS |
30 | | #if _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L |
| 29 | #if (defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L) || defined(__ANDROID__) |
31 | 30 | #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK |
32 | 31 | #define BOOST_PTHREAD_HAS_TIMEDLOCK |
33 | 32 | #endif |
#endif
-#endif
#include <boost/config/abi_prefix.hpp>
@@ -244,7 +243,11 @@
private:
bool do_try_lock_until(struct timespec const &timeout)
{
+#if defined(__ANDROID__) && (__ANDROID_API__ < 21)
+ int const res=pthread_mutex_timedlock(&m,(struct timespec*)&timeout);
+#else
int const res=pthread_mutex_timedlock(&m,&timeout);
+#endif
BOOST_ASSERT(!res || res==ETIMEDOUT);
return !res;
}
diff -r 9266b55758bb -r 7ec78a34de32 boost/thread/pthread/recursive_mutex.hpp
a
|
b
|
(this hunk was shorter than expected)
|
27 | 27 | #endif |
28 | 28 | #include <boost/thread/detail/delete.hpp> |
29 | 29 | |
30 | | #ifdef _POSIX_TIMEOUTS |
31 | | #if _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L |
| 30 | #if (defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0 && _POSIX_TIMEOUTS>=200112L) || defined(__ANDROID__) |
32 | 31 | #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK |
33 | 32 | #define BOOST_PTHREAD_HAS_TIMEDLOCK |
34 | 33 | #endif |
35 | 34 | #endif |
… |
… |
|
267 | 286 | private: |
268 | 287 | bool do_try_lock_until(struct timespec const &timeout) |
269 | 288 | { |
| 289 | #if defined(__ANDROID__) && (__ANDROID_API__ < 21) |
| 290 | int const res=pthread_mutex_timedlock(&m,(struct timespec*)&timeout); |
| 291 | #else |
270 | 292 | int const res=pthread_mutex_timedlock(&m,&timeout); |
| 293 | #endif |
271 | 294 | BOOST_ASSERT(!res || res==ETIMEDOUT); |
272 | 295 | return !res; |
273 | 296 | } |