So im making a user space thread library. lets say theres some program that uses it.
in that program it starts at the main method. before any calls to create_thread, there are no threads active.
then when the first thread is created, the library makes 2 threads. One for 'main' and one for the actual new thead you are making. This is the key step to running in parallel.
One thing I need to make this work is assign a pointer in each thread object I make to the next line of code that should be run when the thread starts. For the thread I create this is easy, it is a pointer to the function.
For the 'main' thread, this should point to the next line of code in main after create.
How do i get this address?