Use short int consistently for unlocks. Check that the waits and unlocks don't overflow.
Compare changes
+ 28
− 5
@@ -747,18 +747,34 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
@@ -1031,10 +1047,17 @@ void scheduler_rewait_mapper(void *map_data, int num_elements,