Synchronized

// only one thread can access this at a time

void synchronized funcName() {
	// code
}
// this can be put inside of a method
// so that only 1 object at a time runs the code

// this can be replaced with an object name
// so the object is only ever run once at a time

synchronized (this) {
	//code
}