void check_wrapper_breakpoint (void *wrapper, int size) { enter_CRITICAL_SECTION(&class_breakpoint_lock); while (class_breakpoints_pending) { set_EVENT(class_breakpoint_events[0]); if (wait_for_EVENT(class_breakpoint_events[1], INFINITE) != EVENT_WAIT_SUCCESS) { // MSG0("check_wrapper_breakpoint: error waiting for class breakpoint event\n"); } } if (check_wrapper_breakpoint_for_objectQ) { signal_wrapper_breakpoint(wrapper, 1, size); } else { if (wrapper_breaks_cursor >= 0) { int index = index_for_wrapper_breaks(wrapper); if (index >= 0) { wrapper_stats_t wrapper_record = wrapper_breaks + index; wrapper_record->usage_count += 1; if (wrapper_record->usage_count >= wrapper_record->usage_size) { signal_wrapper_breakpoint(wrapper, wrapper_record->usage_count, size); wrapper_record->usage_count = 0; } } } } leave_CRITICAL_SECTION(&class_breakpoint_lock); }
STATIC_INLINE void update_runtime_thread_count(int increment) { enter_CRITICAL_SECTION(&reservoir_limit_set_lock); num_threads = num_threads + increment; leave_CRITICAL_SECTION(&reservoir_limit_set_lock); }