I ran Valgrind on my code and it reports a data loss at what seem like pthreads library.
pthreads
The code simply creates a thread with a lambda as function and t