Generalized second law of thermodynamics in black-hole physics