Oh that is right, cannot use DEBUG or printf in locks, then how can I debug this...