implemented send mutexes and cv but no working correctly