On 9/1/25 18:49, Daniel P. Berrangé wrote:
On Sun, Aug 31, 2025 at 08:14:21AM +1000, Richard Henderson wrote:
On 8/30/25 04:03, Daniel P. Berrangé wrote:
+#ifndef PTHREAD_MAX_NAMELEN_NP
+#define PTHREAD_MAX_NAMELEN_NP 16
+#endif
+
+static __thread char namebuf[PTHREAD_MAX_NAMELEN_NP];
If you're going to have this...
+static __thread char namebuf[64];
... or this, why not just remember the name from when we set it?
You could even store a pointer instead of a larger number of characters.
I'll note that all of the names we actually pass to qemu_thread_create are
string literals, and that we don't actually need to do any memory allocation
at all with them.
I was thinking about the possibility there will be threads running that
were not created using qemu_thread_start, given that libraries use threads
behind the scenes and I can't rule out possibility that such threads call
back into QEMU code.
Good point.
r~