The thread APIs seem kind of useless as of now. You get a thread ID, then what? Not much you can do.
I'm thinking of something like LM_GetProcessFromThread, which would actually be useful (especially on *nix, where threads are different processes)
And then I would start using a struct lm_thread_t instead of lm_tid_tbecause I learned the hard way that using only an identifier is not a good idea, maybe I have to pass more information in a later version of libmem and suddenly I have to redesign the whole library.
Windows has GetProcessIdOfThread which I could use to retrieve a handle and get process information. On Linux/FreeBSD, threads IDs are the same as process IDs, so I would just get information as if it were a PID.
The thread APIs seem kind of useless as of now. You get a thread ID, then what? Not much you can do. I'm thinking of something like
LM_GetProcessFromThread
, which would actually be useful (especially on *nix, where threads are different processes) And then I would start using a structlm_thread_t
instead oflm_tid_t
because I learned the hard way that using only an identifier is not a good idea, maybe I have to pass more information in a later version of libmem and suddenly I have to redesign the whole library. Windows hasGetProcessIdOfThread
which I could use to retrieve a handle and get process information. On Linux/FreeBSD, threads IDs are the same as process IDs, so I would just get information as if it were a PID.