Skip to content

Commit

Permalink
lib: Convert THREAD_YIELD_TIME_SLOT to EVENT_YIELD_TIME_SLOT
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Mar 24, 2023
1 parent de2754b commit ba7d270
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static struct event *thread_get(struct thread_master *m, uint8_t type,
thread->add_type = type;
thread->master = m;
thread->arg = arg;
thread->yield = THREAD_YIELD_TIME_SLOT; /* default */
thread->yield = EVENT_YIELD_TIME_SLOT; /* default */
thread->ref = NULL;
thread->ignore_timer_late = false;

Expand Down
2 changes: 1 addition & 1 deletion lib/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct cpu_thread_history {
#define TIMER_SECOND_MICRO 1000000L

/* Thread yield time. */
#define THREAD_YIELD_TIME_SLOT 10 * 1000L /* 10ms */
#define EVENT_YIELD_TIME_SLOT 10 * 1000L /* 10ms */

#define THREAD_TIMER_STRLEN 12

Expand Down
4 changes: 2 additions & 2 deletions lib/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct work_queue *work_queue_new(struct thread_master *m,

/* Default values, can be overridden by caller */
new->spec.hold = WORK_QUEUE_DEFAULT_HOLD;
new->spec.yield = THREAD_YIELD_TIME_SLOT;
new->spec.yield = EVENT_YIELD_TIME_SLOT;
new->spec.retry = WORK_QUEUE_DEFAULT_RETRY;

return new;
Expand Down Expand Up @@ -127,7 +127,7 @@ static int work_queue_schedule(struct work_queue *wq, unsigned int delay)

/* set thread yield time, if needed */
if (thread_is_scheduled(wq->thread) &&
wq->spec.yield != THREAD_YIELD_TIME_SLOT)
wq->spec.yield != EVENT_YIELD_TIME_SLOT)
thread_set_yield_time(wq->thread, wq->spec.yield);
return 1;
} else
Expand Down

0 comments on commit ba7d270

Please sign in to comment.