Answer
(Fatwa: 513/379=L/1430)
(1, 2) If the discharge causes no lust and erection is not lost, then it is mazi (pre-seminal fluid), it did not render ghusl wajib. But, if it is thick and is discharged with lust and jerk and causes relaxation and loss of erection, then it is mani (semen) and it renders ghusl wajib.
(3) Divert your attention from such thoughts and engage yourself in zikr, tilawah etc, such thoughts will automatically come to a stop.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband