Skip to content

Commit 9ded0a2

Browse files
authored
Allow graceful handling of cpuinfo init failure
Differential Revision: D74604740 Pull Request resolved: #10826
1 parent d0b4ed6 commit 9ded0a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extension/threadpool/threadpool.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ void ThreadPool::run(
9696
// get_threadpool is not thread safe due to leak_corrupted_threadpool
9797
// Make this part threadsafe: TODO(kimishpatel)
9898
ThreadPool* get_threadpool() {
99-
ET_CHECK_MSG(cpuinfo_initialize(), "cpuinfo initialization failed");
99+
if (!cpuinfo_initialize()) {
100+
ET_LOG(Error, "cpuinfo initialization failed");
101+
return nullptr; // NOLINT(facebook-hte-NullableReturn)
102+
}
103+
100104
int num_threads = cpuinfo_get_processors_count();
101105
/*
102106
* For llvm-tsan, holding limit for the number of locks for a single thread

0 commit comments

Comments
 (0)