Muslim history reflects a wide variety of historically specific patterns of enslavement, slaveholding, manumission and abolition. Muslims in numerous countries spread across different continents lived as slaveholders and slaves for more than a millennium. Generations of jurists formulated rules that put social practice into conversation with revealed texts as well as customary law, but canonical texts did not always determine behavior. Across and even within societies, slavery encompassed a wide range of practices. "Islamic slavery" included conscript-convert Janissary troops, cooks, nannies, Mamluk military rulers, salt miners, pearl divers, craftsmen allowed to keep part of their wages, mothers of Ottoman sultans and the drudges who cleaned the royal harem quarters. Slavery was hierarchical and slaves were, in some times and places, assigned specific work based on ethnic origins. Slavery was not entirely racialized, however, and slaves were captured or bought from Europe, Asia and the Caucasus as well as Africa.