Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Issue 276043002: Use pthread_mach_thread_np(pthread_self()) instead of mach_thread_self() (Closed)

Created:
6 years, 7 months ago by Mark Mentovai
Modified:
6 years, 7 months ago
Reviewers:
Mark Seaborn
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Use pthread_mach_thread_np(pthread_self()) instead of mach_thread_self(). mach_thread_self() needs to be balanced by mach_port_deallocate(), which is two system calls. The existing uses of mach_thread_self() were not deallocated, which was a bug. pthread_mach_thread_np(pthread_self()) is two libc function calls and no system calls, because pthread caches the Mach port. When using pthread's cached port, no mach_port_deallocate() is necessary (it would be an error to deallocate). Additional background is available in http://crbug.com/105513 . R=mseaborn@chromium.org Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=13165

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M src/shared/platform/osx/nacl_clock.c View 2 chunks +7 lines, -1 line 0 comments Download
M src/trusted/service_runtime/osx/nacl_thread_nice.c View 2 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Mark Mentovai
http://crbug.com/105513 has some additional background. The same strategy is used in trusted/service_runtime/osx/mach_thread_map.c since NaCl r10861 ...
6 years, 7 months ago (2014-05-09 19:40:59 UTC) #1
Mark Seaborn
LGTM, thanks On 2014/05/09 19:40:59, Mark Mentovai wrote: > http://crbug.com/105513 has some additional background. Can ...
6 years, 7 months ago (2014-05-09 19:46:52 UTC) #2
Mark Mentovai
6 years, 7 months ago (2014-05-09 20:34:12 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r13165 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698