tvhthread_create() - remove detach argument

This commit is contained in:
Jaroslav Kysela 2014-07-07 17:15:12 +02:00
parent 2ecc8d0a8b
commit 37d7156f6c
26 changed files with 31 additions and 34 deletions

View file

@ -280,7 +280,7 @@ void
avahi_init(void)
{
avahi_asp = avahi_simple_poll_new();
tvhthread_create(&avahi_tid, NULL, avahi_thread, NULL, 0);
tvhthread_create(&avahi_tid, NULL, avahi_thread, NULL);
}
void

View file

@ -1917,7 +1917,7 @@ capmt_entry_find(const char *id, int create)
tvh_pipe(O_NONBLOCK, &capmt->capmt_pipe);
tvhthread_create(&capmt->capmt_tid, NULL, capmt_thread, capmt, 0);
tvhthread_create(&capmt->capmt_tid, NULL, capmt_thread, capmt);
return capmt;
}

View file

@ -1096,7 +1096,7 @@ cwc_session(cwc_t *cwc)
pthread_cond_init(&cwc->cwc_writer_cond, NULL);
pthread_mutex_init(&cwc->cwc_writer_mutex, NULL);
TAILQ_INIT(&cwc->cwc_writeq);
tvhthread_create(&writer_thread_id, NULL, cwc_writer_thread, cwc, 0);
tvhthread_create(&writer_thread_id, NULL, cwc_writer_thread, cwc);
/**
* Mainloop
@ -2127,7 +2127,7 @@ cwc_entry_find(const char *id, int create)
cwc->cwc_running = 1;
TAILQ_INSERT_TAIL(&cwcs, cwc, cwc_link);
tvhthread_create(&cwc->cwc_tid, NULL, cwc_thread, cwc, 0);
tvhthread_create(&cwc->cwc_tid, NULL, cwc_thread, cwc);
return cwc;
}

View file

@ -70,7 +70,7 @@ void dvr_inotify_init ( void )
return;
}
tvhthread_create(&dvr_inotify_tid, NULL, _dvr_inotify_thread, NULL, 0);
tvhthread_create(&dvr_inotify_tid, NULL, _dvr_inotify_thread, NULL);
}
/**

View file

@ -92,7 +92,7 @@ dvr_rec_subscribe(dvr_entry_t *de)
buf, st, flags,
NULL, NULL, NULL);
tvhthread_create(&de->de_thread, NULL, dvr_thread, de, 0);
tvhthread_create(&de->de_thread, NULL, dvr_thread, de);
}
/**

View file

@ -385,7 +385,7 @@ void epggrab_init ( void )
/* Start internal grab thread */
epggrab_running = 1;
tvhthread_create(&epggrab_tid, NULL, _epggrab_internal_thread, NULL, 0);
tvhthread_create(&epggrab_tid, NULL, _epggrab_internal_thread, NULL);
}
/*

View file

@ -435,7 +435,7 @@ epggrab_module_enable_socket ( void *m, uint8_t e )
tvhlog(LOG_DEBUG, mod->id, "starting socket thread");
pthread_attr_init(&tattr);
mod->enabled = 1;
tvhthread_create(&mod->tid, &tattr, _epggrab_socket_thread, mod, 0);
tvhthread_create(&mod->tid, &tattr, _epggrab_socket_thread, mod);
}
return 1;
}

View file

@ -104,7 +104,7 @@ fsmonitor_init ( void )
{
/* Intialise inotify */
fsmonitor_fd = inotify_init();
tvhthread_create0(&fsmonitor_tid, NULL, fsmonitor_thread, NULL, "fsmonitor", 0);
tvhthread_create0(&fsmonitor_tid, NULL, fsmonitor_thread, NULL, "fsmonitor");
}
/*

View file

@ -2214,7 +2214,7 @@ htsp_serve(int fd, void **opaque, struct sockaddr_storage *source,
pthread_mutex_unlock(&global_lock);
tvhthread_create(&htsp.htsp_writer_thread, NULL,
htsp_write_scheduler, &htsp, 0);
htsp_write_scheduler, &htsp);
/**
* Reader loop

View file

@ -1377,7 +1377,7 @@ http_client_init ( const char *user_agent )
/* Setup thread */
http_running = 1;
tvhthread_create(&http_client_tid, NULL, http_client_thread, NULL, 0);
tvhthread_create(&http_client_tid, NULL, http_client_thread, NULL);
#if HTTPCLIENT_TESTSUITE
http_client_testsuite_run();
#endif

View file

@ -73,7 +73,7 @@ idnode_init(void)
idnode_queue = NULL;
pthread_mutex_init(&idnode_mutex, NULL);
pthread_cond_init(&idnode_cond, NULL);
tvhthread_create(&idnode_tid, NULL, idnode_thread, NULL, 0);
tvhthread_create(&idnode_tid, NULL, idnode_thread, NULL);
}
void

View file

@ -347,7 +347,7 @@ imagecache_init ( void )
/* Start threads */
#if ENABLE_IMAGECACHE
tvhthread_create(&imagecache_tid, NULL, imagecache_thread, NULL, 0);
tvhthread_create(&imagecache_tid, NULL, imagecache_thread, NULL);
/* Re-try timer */
// TODO: this could be more efficient by being targetted, however

View file

@ -552,7 +552,7 @@ void iptv_init ( void )
/* Setup TS thread */
iptv_poll = tvhpoll_create(10);
pthread_mutex_init(&iptv_lock, NULL);
tvhthread_create(&iptv_thread, NULL, iptv_input_thread, NULL, 0);
tvhthread_create(&iptv_thread, NULL, iptv_input_thread, NULL);
}
void iptv_done ( void )

View file

@ -508,7 +508,7 @@ linuxdvb_frontend_monitor ( void *aux )
tvh_pipe(O_NONBLOCK, &lfe->lfe_dvr_pipe);
pthread_mutex_lock(&lfe->lfe_dvr_lock);
tvhthread_create(&lfe->lfe_dvr_thread, NULL,
linuxdvb_frontend_input_thread, lfe, 0);
linuxdvb_frontend_input_thread, lfe);
pthread_cond_wait(&lfe->lfe_dvr_cond, &lfe->lfe_dvr_lock);
pthread_mutex_unlock(&lfe->lfe_dvr_lock);

View file

@ -872,9 +872,9 @@ mpegts_input_thread_start ( mpegts_input_t *mi )
mi->mi_running = 1;
tvhthread_create(&mi->mi_table_tid, NULL,
mpegts_input_table_thread, mi, 0);
mpegts_input_table_thread, mi);
tvhthread_create(&mi->mi_input_tid, NULL,
mpegts_input_thread, mi, 0);
mpegts_input_thread, mi);
}
static void

View file

@ -1287,7 +1287,7 @@ satip_frontend_tune0
tvh_pipe(O_NONBLOCK, &lfe->sf_dvr_pipe);
tvhthread_create(&lfe->sf_dvr_thread, NULL,
satip_frontend_input_thread, lfe, 0);
satip_frontend_input_thread, lfe);
gtimer_arm_ms(&lfe->sf_monitor_timer, satip_frontend_signal_cb, lfe, 50);

View file

@ -228,7 +228,7 @@ tsfile_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *t )
return SM_CODE_TUNING_FAILED;
}
tvhtrace("tsfile", "adapter %d starting thread", mi->mi_instance);
tvhthread_create(&ti->ti_thread_id, NULL, tsfile_input_thread, mi, 0);
tvhthread_create(&ti->ti_thread_id, NULL, tsfile_input_thread, mi);
}
/* Current */

View file

@ -1247,7 +1247,7 @@ service_init(void)
TAILQ_INIT(&service_all);
pthread_mutex_init(&pending_save_mutex, NULL);
pthread_cond_init(&pending_save_cond, NULL);
tvhthread_create(&service_saver_tid, NULL, service_saver, NULL, 0);
tvhthread_create(&service_saver_tid, NULL, service_saver, NULL);
}
void

View file

@ -51,7 +51,7 @@ service_mapper_init ( void )
{
TAILQ_INIT(&service_mapper_queue);
pthread_cond_init(&service_mapper_cond, NULL);
tvhthread_create(&service_mapper_tid, NULL, service_mapper_thread, NULL, 0);
tvhthread_create(&service_mapper_tid, NULL, service_mapper_thread, NULL);
}
void

View file

@ -528,7 +528,7 @@ tcp_server_loop(void *aux)
pthread_mutex_lock(&global_lock);
LIST_INSERT_HEAD(&tcp_server_active, tsl, alink);
pthread_mutex_unlock(&global_lock);
tvhthread_create(&tsl->tid, NULL, tcp_server_start, tsl, 0);
tvhthread_create(&tsl->tid, NULL, tcp_server_start, tsl);
}
}
tvhtrace("tcp", "server thread finished");
@ -692,7 +692,7 @@ tcp_server_init(int opt_ipv6)
tvhpoll_add(tcp_server_poll, &ev, 1);
tcp_server_running = 1;
tvhthread_create(&tcp_server_tid, NULL, tcp_server_loop, NULL, 0);
tvhthread_create(&tcp_server_tid, NULL, tcp_server_loop, NULL);
}
void

View file

@ -278,8 +278,8 @@ streaming_target_t *timeshift_create
/* Initialise input */
streaming_queue_init(&ts->wr_queue, 0);
streaming_target_init(&ts->input, timeshift_input, ts, 0);
tvhthread_create(&ts->wr_thread, NULL, timeshift_writer, ts, 0);
tvhthread_create(&ts->rd_thread, NULL, timeshift_reader, ts, 0);
tvhthread_create(&ts->wr_thread, NULL, timeshift_writer, ts);
tvhthread_create(&ts->rd_thread, NULL, timeshift_reader, ts);
/* Update index */
timeshift_index++;

View file

@ -349,7 +349,7 @@ void timeshift_filemgr_init ( void )
pthread_cond_init(&timeshift_reaper_cond, NULL);
TAILQ_INIT(&timeshift_reaper_list);
tvhthread_create(&timeshift_reaper_thread, NULL,
timeshift_reaper_callback, NULL, 1);
timeshift_reaper_callback, NULL);
}
/*

View file

@ -576,9 +576,9 @@ void doexit(int x);
int tvhthread_create0
(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg,
const char *name, int detach);
const char *name);
#define tvhthread_create(a, b, c, d, e) tvhthread_create0(a, b, c, d, #c, e)
#define tvhthread_create(a, b, c, d) tvhthread_create0(a, b, c, d, #c)
int tvh_open(const char *pathname, int flags, mode_t mode);

View file

@ -423,7 +423,7 @@ void
tvhlog_start ( void )
{
tvhlog_run = 1;
tvhthread_create(&tvhlog_tid, NULL, tvhlog_thread, NULL, 0);
tvhthread_create(&tvhlog_tid, NULL, tvhlog_thread, NULL);
}
void

View file

@ -197,7 +197,7 @@ upnp_server_init(const char *bindaddr)
TAILQ_INIT(&upnp_data_write);
TAILQ_INIT(&upnp_services);
upnp_running = 1;
tvhthread_create(&upnp_tid, NULL, upnp_thread, (char *)bindaddr, 0);
tvhthread_create(&upnp_tid, NULL, upnp_thread, (char *)bindaddr);
}
void

View file

@ -131,8 +131,7 @@ thread_wrapper ( void *p )
int
tvhthread_create0
(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg, const char *name,
int detach)
void *(*start_routine) (void *), void *arg, const char *name)
{
int r;
struct thread_state *ts = calloc(1, sizeof(struct thread_state));
@ -140,8 +139,6 @@ tvhthread_create0
ts->run = start_routine;
ts->arg = arg;
r = pthread_create(thread, attr, thread_wrapper, ts);
if (detach)
pthread_detach(*thread);
return r;
}