example codes for lecture on race conditions