Skip to content

Commit

Permalink
Cherry pick PR #3934: Set stack size when run agent (#3963)
Browse files Browse the repository at this point in the history
Refer to the original PR: #3934

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

Co-authored-by: MSoliankoLuxoft <[email protected]>
  • Loading branch information
1 parent 2522398 commit 1ce5a18
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 1ce5a18

Please sign in to comment.