proc_test: code cleanup and introduce a synchronization barrier also for non-preempti...