Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/threadpool/threadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool ThreadPool::_unsafe_reset_threadpool(uint32_t new_thread_count) {
}

void ThreadPool::run(
const std::function<void(size_t)>& fn,
runtime::FunctionRef<void(size_t)> fn,
const size_t range) {
// Run on same thread if NoThreadPoolGuard guard is enabled
if (NoThreadPoolGuard::is_enabled()) {
Expand Down
4 changes: 3 additions & 1 deletion extension/threadpool/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <pthreadpool.h>

#include <executorch/runtime/core/function_ref.h>

/*
* Threadpool Options:
*
Expand Down Expand Up @@ -74,7 +76,7 @@ class ThreadPool final {
* multiple threads with the scope of the guard When NoThreadPoolGuard is not
* used all calls to run method are serialized.
*/
void run(const std::function<void(size_t)>& fn, size_t range);
void run(runtime::FunctionRef<void(size_t)> fn, size_t range);

private:
friend pthreadpool_t get_pthreadpool();
Expand Down
Loading