From 8d55a9c9512465096f9ecaa4096baa379c6c8bfa Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 13 Aug 2023 23:21:42 -0700 Subject: main: switch to til_fb_halt() This gets rid of the rototiller_thread() pthread_cancel() based exit which seemed to rarely make clang's ASAN (-fsanitize=address) very angry with a segfault in libc somewhere Instead of trying to chase that down I'm just getting rid of it, it's unnecessary. --- src/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index fbbd14a..7077129 100644 --- a/src/main.c +++ b/src/main.c @@ -334,10 +334,15 @@ static void * rototiller_thread(void *_rt) rototiller_t *rt = _rt; struct timeval now; - for (;;) { - unsigned ticks; + while (til_stream_active(rt->stream)) { + unsigned ticks; rt->fragment = til_fb_page_get(rt->fb); + if (!rt->fragment) { + til_stream_end(rt->stream); + continue; + } + gettimeofday(&now, NULL); ticks = get_ticks(&rt->start_tv, &now, rt->ticks_offset); til_module_render(rt->module_context, rt->stream, ticks, &rt->fragment); @@ -425,7 +430,7 @@ int main(int argc, const char *argv[]) fps_fprint(rototiller.fb, stderr); } - pthread_cancel(rototiller.thread); + til_fb_halt(rototiller.fb); pthread_join(rototiller.thread, NULL); til_quiesce(); -- cgit v1.2.3