Files
sdk/runtime/bin/thread.cc
Ryan Macnak 0c3606f0ec [vm] Systematically check for failure to start thread.
Improve error message to include the intended thread name and strerror.

TEST=ci
Change-Id: Iba61a40b312f6574e8e352d51a0c3de535f6a0c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386361
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-09-24 22:41:40 +00:00

26 lines
739 B
C++

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "bin/thread.h"
#include "platform/utils.h"
namespace dart {
namespace bin {
void Thread::Start(const char* name,
ThreadStartFunction function,
uword parameter) {
int result = TryStart(name, function, parameter);
if (result != 0) {
const int kBufferSize = 1024;
char error_buf[kBufferSize];
FATAL("Could not start thread %s: %d (%s)", name, result,
Utils::StrError(result, error_buf, kBufferSize));
}
}
} // namespace bin
} // namespace dart