his duties were primarily those of constable , customs inspector , and when needed , executioner ; his title came from the wooden `` lock '' or scoop that hung from his belt , with which he was entitled to take a percentage of each bag of grain sold in the thursday market : the remuneration of his office .