yeah i am creating a multi threaded application but i am not allowed to use any libraries etc. Its a bare metal implementation so i need to find a way to do it myself. I am using Pthreads just to emulate the physical cores of a system.
In the user application you should declare the finished variable volatile.
In the package.cpp you should capture the pointer (or a reference) to the variable. E.g.
//other memeber variables inside ctor
m_pfinished = finished; // capture the pointer not the value
*m_pfinished = true; // change the original 'finished' content