Skip to content

Commit

Permalink
Set stack size when run agent (#3934)
Browse files Browse the repository at this point in the history
Set up a custom stack size for the web module creation process. On
certain platforms, the default stack size is insufficient, leading to
stack overflow issues.

b/357525935
  • Loading branch information
MSoliankoLuxoft authored Aug 9, 2024
1 parent a075f8b commit 039052d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cobalt/web/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,9 @@ void Agent::Run(const Options& options, InitializeCallback initialize_callback,
DestructionObserver* destruction_observer) {
// Start the dedicated thread and create the internal implementation
// object on that thread.
if (!thread_.StartWithOptions(base::Thread::Options(options.thread_priority)))
return;
base::Thread::Options thread_options(options.thread_priority);
thread_options.stack_size = options.stack_size;
if (!thread_.StartWithOptions(std::move(thread_options))) return;
DCHECK(task_runner());

// Registers service worker thread as a watchdog client.
Expand Down

0 comments on commit 039052d

Please sign in to comment.