Flying from LGW-CVG, the captain said that the cockpit lav was closed for security reasons and was a "restricted area." He thanked us for our understanding. That's one in about a dozen segments since 9/11, so overall, its not too difficult to use the restroom.