What is the origin of the phrase the jig is up?

"The jig is up" is a phrase that refers to a person being found out or exposed. The phrase has it's origin in the racist South because it refers to the lynching of slaves and African Americans.