s -> sockfd, added lock and unlock