the_Foundation [main]

Thread: Querying name of the main thread

=> f68b20c34d8fad795305ebf284cbbd9b3fe02781

diff --git a/src/thread.c b/src/thread.c
index 98af25b..f2acaa9 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -159,6 +159,13 @@ iBool isFinished_Thread(const iThread *d) {
 }
 
 const iString *name_Thread(const iThread *d) {
+    if (!d) {
+        static iString *name_;
+        if (!name_) {
+            name_ = newCStr_String("main thread");
+        }
+        return name_;
+    }
     return &d->name;
 }
 
Proxy Information
Original URL
gemini://git.skyjake.fi/the_Foundation/main/cdiff/f68b20c34d8fad795305ebf284cbbd9b3fe02781
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
29.963137 milliseconds
Gemini-to-HTML Time
0.223415 milliseconds

This content has been proxied by September (ba2dc).