Commit 262c6c3b authored by Wez's avatar Wez Committed by Commit Bot

Migrate to the zx_task_suspend_token() API.

This is a temporary rename of zx_task_suspend(), to allow the API
signature to be updated. It will be followed by a rename back to the
old name, with the new signature.

Change-Id: I896d714e556dad2e0740891ff99cb0b51c6c1943
Reviewed-on: https://chromium-review.googlesource.com/1158998Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54850}
parent 94087c80
......@@ -714,7 +714,8 @@ void Sampler::DoSample() {
zx_handle_t profiled_thread = platform_data()->profiled_thread();
if (profiled_thread == ZX_HANDLE_INVALID) return;
if (zx_task_suspend(profiled_thread) != ZX_OK) return;
zx_handle_t suspend_token = ZX_HANDLE_INVALID;
if (zx_task_suspend_token(profiled_thread, &suspend_token) != ZX_OK) return;
// Wait for the target thread to become suspended, or to exit.
// TODO(wez): There is currently no suspension count for threads, so there
......@@ -726,7 +727,7 @@ void Sampler::DoSample() {
profiled_thread, ZX_THREAD_SUSPENDED | ZX_THREAD_TERMINATED,
zx_deadline_after(ZX_MSEC(100)), &signals);
if (suspended != ZX_OK || (signals & ZX_THREAD_SUSPENDED) == 0) {
zx_task_resume(profiled_thread, 0);
zx_handle_close(suspend_token);
return;
}
......@@ -747,7 +748,7 @@ void Sampler::DoSample() {
SampleStack(state);
}
zx_task_resume(profiled_thread, 0);
zx_handle_close(suspend_token);
}
// TODO(wez): Remove this once the Fuchsia SDK has rolled.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment