summaryrefslogtreecommitdiff
path: root/src/til_threads.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-04-19 15:36:06 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-04-19 15:36:06 -0700
commit53d4d504b9103f524c50385ed3545fd08d0e272e (patch)
tree3f540f6bd1a0c6eb6301f15ebf3376e9c6fdaf68 /src/til_threads.c
parentca14c4bf346a200ab8a66be293d8e71d49e09e32 (diff)
*: s/til_fb_fragment_zero/til_fb_fragment_clear/
Mechanical renaming of "zero" to "clear" throughout for this context.
Diffstat (limited to 'src/til_threads.c')
-rw-r--r--src/til_threads.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/til_threads.c b/src/til_threads.c
index 6f01db1..a3f6f7e 100644
--- a/src/til_threads.c
+++ b/src/til_threads.c
@@ -19,7 +19,7 @@ typedef struct til_threads_t {
pthread_mutex_t idle_mutex;
pthread_cond_t idle_cond;
unsigned idle_n_fragments;
- unsigned idle_n_zeroed;
+ unsigned idle_n_cleared;
unsigned n_idle;
pthread_mutex_t frame_mutex;
@@ -47,7 +47,7 @@ static void * thread_func(void *_thread)
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
for (;;) {
- unsigned n_fragments = 0, n_zeroed = 0;
+ unsigned n_fragments = 0, n_cleared = 0;
/* wait for a new frame */
pthread_mutex_lock(&threads->frame_mutex);
@@ -68,7 +68,7 @@ static void * thread_func(void *_thread)
break;
threads->render_fragment_func(threads->context, threads->ticks, thread->id, &fragment);
- n_zeroed += fragment.zeroed;
+ n_cleared += fragment.cleared;
n_fragments++;
}
@@ -76,11 +76,11 @@ static void * thread_func(void *_thread)
pthread_mutex_lock(&threads->idle_mutex);
pthread_cleanup_push((void (*)(void *))pthread_mutex_unlock, &threads->idle_mutex);
threads->idle_n_fragments += n_fragments;
- threads->idle_n_zeroed += n_zeroed;
+ threads->idle_n_cleared += n_cleared;
threads->n_idle++;
if (threads->n_idle == threads->n_threads) { /* Frame finished! Notify potential waiter. */
- if (threads->idle_n_zeroed == threads->idle_n_fragments)
- threads->fragment->zeroed = 1;
+ if (threads->idle_n_cleared == threads->idle_n_fragments)
+ threads->fragment->cleared = 1;
pthread_cond_signal(&threads->idle_cond);
}
@@ -115,7 +115,7 @@ void til_threads_frame_submit(til_threads_t *threads, til_fb_fragment_t *fragmen
threads->context = context;
threads->ticks = ticks;
threads->frame_num++;
- threads->n_idle = threads->idle_n_zeroed = threads->idle_n_fragments = threads->next_fragment = 0;
+ threads->n_idle = threads->idle_n_cleared = threads->idle_n_fragments = threads->next_fragment = 0;
pthread_cond_broadcast(&threads->frame_cond);
pthread_cleanup_pop(1);
}
© All Rights Reserved