emscripten-core/emscripten

Name pthread workers for easier debugging

Aberta

#12.216 aberto em 15 de set. de 2020

 (12 comentários) (3 reações) (0 responsável)C++ (3.519 forks)batch import
good first bughelp wanted

Métricas do repositório

Stars
 (27.361 estrelas)
Métricas de merge de PR
 (Mesclagem média 19d 10h) (147 fundiu PRs em 30d)

Description

This is a feature suggestion.

Workers accept an optional name which can be used for debugging, e.g. in DevTools we show the name in the Sources panel. Screen Shot 2020-09-15 at 10 55 05 am Screen Shot 2020-09-15 at 10 55 12 am

The name is also available to the worker via globalThis.name.

My suggestion is that in src/library_pthread.js, in allocateUnusedWorker when we call new Worker(), we give a useful name like pthread #1 etc. Right now threads just show up with the file name (which also means all the threads have the same name).

Guia do colaborador