forget to free sema: block waiting thread must free sema if select did not set his readfds!