diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2014-01-10 12:02:22 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-01-14 19:12:55 +0000 |
commit | 6d4f5491a3f8194ea016e662a1501c5830f5657f (patch) | |
tree | 9f0425bca8fb37a2763a3de2325fd4f97246972e | |
parent | 5d454c2f8bc5a5e2f55823018792db7f264f2ab0 (diff) | |
download | chrome-ec-6d4f5491a3f8194ea016e662a1501c5830f5657f.tar.gz |
Use pthread_equal() to compare thread ID
Pthread document explicitly stated that == operator should not be used
to compare thread IDs. Let's use pthread_equal() to be safe.
BUG=None
Original-BUG=chrome-os-partner:19235
TEST=Check trace dump can be generated from non-main thread
BRANCH=None
Change-Id: I91433d2342a7a15cd4864a641ba610464a061e79
Original-Change-Id: I9984f70d74a817d8838150970893b6d2e41e5d0c
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182039
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182282
Commit-Queue: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/182461
Reviewed-by: Dave Parker <dparker@chromium.org>
-rw-r--r-- | core/host/task.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/host/task.c b/core/host/task.c index e560b4c59d..08c70da66b 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -178,7 +178,7 @@ static void __attribute__((noinline)) _task_dump_trace_dispatch(int sig) { int need_dispatch = 1; - if (pthread_self() != main_thread) { + if (!pthread_equal(pthread_self(), main_thread)) { need_dispatch = 0; } else if (!task_start_called()) { fprintf(stderr, "Stack trace of main thread:\n"); |