Correction : initialization on the same line as declaration makes a shared object. Threads shares therfor the variable which should not be the case here.