The thiol nucleophile for this reaction is just a tautomer of a thioamide. Thioamides are one of the few stable thiocarbonyl derivatives and can be made easily from conventional amides and P2S5 or Lawesson’s reagent
When a thioamide reacts with an α-haloketone: an interesting question arises. Both the nitrogen and the sulfur act as nucleophiles, so which one attacks the oxygen and which one attacks the halogen?
Carbonyl groups are ‘hard’ electrophiles- their reactions are usually charged controlled, and so react well with basic ‘hard’ nucleophiles. Alkyl halides are ‘soft’ electrophiles – their reactions are mainly under frontier orbital control and react best with large, ‘soft’, uncharged nucleophiles from lower down in the periodic table. So the ketone reacts with the nitrogen and the alkyl halide reacts with the sulfur.
Full mechanism of this reaction.