diff options
author | Junjie Hu <junjie.hu@mediatek.com> | 2015-11-11 12:52:25 +0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-11-11 21:21:21 +0000 |
commit | de1246202a229efe555170a7c5803510f5975658 (patch) | |
tree | e6d531e81a0546cc4cda65d6b99f71f49191ec9a /libc/stdio/stdio_ext.cpp | |
parent | 6209b99a7351ed732ab25bb2ffa75465366b244f (diff) |
Fix potential race condition on CTS TC pthread_gettid_np
Root cause:
If start_routine thread exits before pthread_gettid_np is invokded, the "tid" field
will be cleared so that pthread_gettid_np will get "0" (which is cleared by kernel,
due to the flag "CLONE_CHILD_CLEARTID" is set while calling clone system call inside
pthread_create).
Proposed patch:
Use a mutex to guarantee pthread_gettid_np will be invoked and returned before the
start_routine exits
Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>
Change-Id: I22411f1b0f7446d76a0373cef4ccec858fac7018
(cherry picked from commit 4f8010293506d4e08d184e66bf4af44ef3483611)
Diffstat (limited to 'libc/stdio/stdio_ext.cpp')
0 files changed, 0 insertions, 0 deletions