THIS_THREAD(3em)
β¨ NAME β¨
Okay bestie, welcome to the this_thread(3em) page π β this one's all about this_thread, aka the Emilua bindings for C++'s this_thread. Slay.
πΈ DESCRIPTION πΈ
First things first, here's the whole vibe in code:
local this_thread = require 'this_thread'
print(this_thread.get_id())
So here's the tea β: on some Linux systems, getting the thread ID from C++-created threads using pthread_self() is unreliable. Like, genuinely not it. π So if you're debugging your Lua application and you're planning to use FFI to call pthread_self(), you're bound to find trouble β no cap.
Instead, you can use this module to get the current thread-id by interfacing with the C++ runtime directly. Iconic behavior, honestly. π
Lowkey important: that pthread_self() unreliability on some Linux systems is the whole reason this module exists. Don't skip the warning, bestie. π
That's the whole page, fr fr β short and sweet, just like a good group-chat voice note. π
This little gem comes from Emilua 0.12.1, dated 1980-01-01, and it lives under the THIS_THREAD(3em) manual name. Catch you in the next manpage, bestie! π¦β¨
π¦ where this page comes from
- nixos 26.05: emilua-this-thread 1.0.3
- nixpkgs unstable: emilua-this-thread 1.0.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms