The calAddActiveCellX2D() must be moved to the "unsafe source file". In fact, it modifies the state of a neighboring cell, which is an unsafe opration due to concurrency. Specifically:
calAddActiveCellX2D() function must move from cal2D.h/cal2D.c to cal2DUnsafe.h/cal2DUnsafe.c
calAddActiveCellX3D() function must move from cal3D.h/cal3D.c to cal3DUnsafe.h/cal3DUnsafe.c
The calAddActiveCellX2D() must be moved to the "unsafe source file". In fact, it modifies the state of a neighboring cell, which is an unsafe opration due to concurrency. Specifically: