In one comment you write that your main thread ends. Taken from the pthread_create man page:
The new thread terminates in one of the following ways:
[...]
* Any of the threads in the process calls exit(3), or the main thread
performs a return from main(). This causes the termination of all
threads in the process.
Your main thread needs to pthread_join
to wait for the sender to terminate.