summaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/malloc_hooks.cpp
diff options
context:
space:
mode:
authorJunjie Hu <junjie.hu@mediatek.com>2015-11-11 12:52:25 +0800
committerJunjie Hu <junjie.hu@mediatek.com>2015-11-11 04:54:52 +0000
commit4f8010293506d4e08d184e66bf4af44ef3483611 (patch)
treed1c073a2a0207b48af767f78592155ffe9768692 /libc/malloc_hooks/malloc_hooks.cpp
parent93a91f0cf4f015762ac1ed57395c4c0de8ba7db3 (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
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions