Join GitHub today
Add methods to get the ID of a std.os.Thread, and to get ID of current thread #1316
Being able to get the current thread ID would be handy for various things. Here are two specific examples that are relevant to the project I'm working on at the moment:
Strawman proposal for code in
I think you can accomplish this in the places you need it (e.g. in your allocator code) with thread local storage (#924) like this:
Every thread gets assigned a unique id, which you could use in your mutex or allocator use cases to distinguish.