Heatmap assignment with C PThreads library