mirror of
https://github.com/linux-msm/rmtfs.git
synced 2024-11-23 12:14:12 +08: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:
parent
30f5dfb890
commit
bf5cb9faf2
14
rproc.c
14
rproc.c
@ -187,7 +187,12 @@ static void *do_rproc_start(void *unused)
|
|||||||
|
|
||||||
int rproc_start()
|
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)
|
static void *do_rproc_stop(void *unused)
|
||||||
@ -211,5 +216,10 @@ static void *do_rproc_stop(void *unused)
|
|||||||
|
|
||||||
int rproc_stop(void)
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user