mirror of
https://github.com/linux-msm/rmtfs.git
synced 2025-12-24 14:06:25 +01:00
rproc: Make start & stop threads detached
We're not joining the start and stop threads, so create them in detached state to avoid having their resources lingering. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
14
rproc.c
14
rproc.c
@@ -187,7 +187,12 @@ static void *do_rproc_start(void *unused)
|
||||
|
||||
int rproc_start()
|
||||
{
|
||||
return pthread_create(&start_thread, NULL, do_rproc_start, NULL);
|
||||
pthread_attr_t attr;
|
||||
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
return pthread_create(&start_thread, &attr, do_rproc_start, NULL);
|
||||
}
|
||||
|
||||
static void *do_rproc_stop(void *unused)
|
||||
@@ -211,5 +216,10 @@ static void *do_rproc_stop(void *unused)
|
||||
|
||||
int rproc_stop(void)
|
||||
{
|
||||
return pthread_create(&stop_thread, NULL, do_rproc_stop, NULL);
|
||||
pthread_attr_t attr;
|
||||
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
return pthread_create(&stop_thread, &attr, do_rproc_stop, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user