In function b() you sleep for 1 second and in a() you try to join the corresponding lthread with a timeout of 10 milliseconds.