-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unified header system doesn't provide pthread_mutex_lock_timeout_np
#420
Comments
The proper API for this isn't available until L, so expose this for API levels earlier than that. Test: make checkbuild Bug: android/ndk#420 Change-Id: I382b8f557be9530f3e13aaae353b4a6e7f9301ab
The fix has been merged into r15b. I'm sending build 4113355 of ndk-r15-release off to QA here in a bit if you want to grab the RC from the build server (https://android.googlesource.com/platform/ndk/+/master/docs/ContinuousBuilds.md), otherwise it should be out some time this week. |
@DanAlbert: I just installed build from here: This does not seem to fix my problem. Boost Thread isn't able to find it:
I'm using API 15. This worked fine when I wasn't using the unified headers. What do I need to do to get this working again? |
That code shouldn't work for either set of headers if you're targeting API 15 (it should work for 64-bit ABIs, but that's because 15 should be translated to 21 for those). What ABI are you targeting, and what build system are you using? |
The check in boost looks fine: https://github.com/boostorg/thread/blob/develop/include/boost/thread/pthread/mutex.hpp#L30 Are you manually passing |
Using CMake 3.8.1. ABI is
|
@DanAlbert I'm not specifying that compiler definition myself. But in
Could this be the cause? |
No, that check is fine. The first half of the or fails because The second half is fine because you're not targeting 21+, so neither case should be true, and it shouldn't be defined. Can you provide the failing compilation command? The |
@DanAlbert As I showed in #423, this patch is not enough. Please supply all defines and functions that were declared in pthread.h before android-21. |
i don't think that's true... i built boost with just that patch (with https://gist.github.com/enh/b2dc8e2cbbce7fffffde2135271b10fd and a locally modified toolchain). |
yeah, boost 1.64.0 builds fine for me if i replace my hacked r15 with clean r15b (though note that the bootstrap step requires that "clang" is a working host clang, so i had to have a symlink to /usr/bin/clang-3.8 on my ubuntu box). |
I'm using boost 1.63. I'll get you the command invocation later. |
@alexcohn: sorry for missing all the details in the other bug, I've uploaded a change to re-expose some more legacy APIs. That should actually be affecting this bug though because the missing API here is the one we did expose. @rcdailey: Alright, please do. That should help figure out what's going on. |
@DanAlbert I must have had some other issue, because I'm not able to reproduce this anymore. Sorry for the confusion. This looks to be working fine under API 15. |
The proper API for this isn't available until L, so expose this for API levels earlier than that. Test: make checkbuild Bug: android/ndk#420 Change-Id: I382b8f557be9530f3e13aaae353b4a6e7f9301ab
Description
usr/include/pthread.h
in the unified sysroot folder doesn't havepthread_mutex_lock_timeout_np
, which was the standard way to lock a mutex with timeout on platforms less thanandroid-21
. Now the only method to lock a mutex with timeout ispthread_mutex_timedlock
which is only available inandroid-21
and above. I suspect this is a bug with the unified header system, which I would expect to providepthread_mutex_lock_timeout_np
for__ANDROID_API__ < 21
. Right now there is no way to target versions less thanandroid-21
that uses a system based mutex lock with timeout.We have made a workaround (that still uses the unified header system) for it, that emulates the behavior, but is probably slower than what the kernel can provide.
Environment Details
The text was updated successfully, but these errors were encountered: