void (boolean isAssigned) { if (isAssigned) { if (myAssignments == 0) mySynchronizer.startListen(); myAssignments++; } else { myAssignments--; if (myAssignments == 0) mySynchronizer.stopListen(); } assert myAssignments >= 0; }