Derrick Middleton was walking the streets of Harlem in search of a haircut when he was invited into a shop by a barber. He sat in a chair, and the barber covered him in a white protective cape.

Mr. Middleton began to describe in precise detail what kind of cut he wanted, but was interrupted.

“Yo, yo, yo!” Mr. Middleton said that the barber shouted, so loudly it silenced the rest of the shop. “This ain’t no beauty salon. We don’t do that sissy stuff here,” the barber, using an expletive, said, Mr. Middleton recalled.

Mr. Middleton, 32, said the barber snatched the cape off and ordered him out. “No one came to my defense, not even the owner of the shop,” he said.

Over generations, barbershops have become so culturally integral to black communities that they have been the setting of a blockbuster movie franchise, the focus of rigorous academic study, the stage for popular music videos and comedy skits and, most recently, the backdrop for an HBO talk show from the N.B.A. superstar LeBron James.