Optimize away the tsd_fast() check on fastpath.

Fold the tsd_state check onto the event threshold check.  The fast threshold is
set to 0 when tsd switch to non-nominal.

The fast_threshold can be reset by remote threads, to refect the non nominal tsd
state change.
This commit is contained in:
Qi Wang
2019-11-11 16:34:48 -08:00
committed by Qi Wang
parent 1decf958d1
commit dd649c9485
6 changed files with 144 additions and 21 deletions

View File

@@ -7,8 +7,6 @@ TEST_BEGIN(test_next_event_fast_roll_back) {
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX - 8U);
thread_allocated_next_event_set(tsd,
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX);
thread_allocated_next_event_fast_set(tsd,
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX);
#define E(event, condition) \
event##_event_wait_set(tsd, \
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX);
@@ -27,7 +25,6 @@ TEST_BEGIN(test_next_event_fast_resume) {
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX + 8U);
thread_allocated_next_event_set(tsd,
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX + 16U);
thread_allocated_next_event_fast_set(tsd, 0);
#define E(event, condition) \
event##_event_wait_set(tsd, \
THREAD_ALLOCATED_NEXT_EVENT_FAST_MAX + 16U);