Add initialization pthread_attr struct 18/88218/8
authorAlexander Aksenov <a.aksenov@samsung.com>
Wed, 14 Sep 2016 16:13:14 +0000 (19:13 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Wed, 26 Oct 2016 18:31:34 +0000 (21:31 +0300)
Now probe library is loaded very early for common apps
and that time pthread attribute default structure is not
initialized yet, so we do it manually

Change-Id: I7bf62cf6f52b08116aca2436455bf2011ecc5690
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
helper/libdaprobe.c

index 3508db6..35abc2d 100755 (executable)
@@ -472,11 +472,18 @@ static int init_timerfd(void)
 
 static int create_recv_thread()
 {
-       int err = pthread_create(&g_recvthread_id, NULL, recv_thread, NULL);
+       int err;
+       pthread_attr_t attr;
+
+       pthread_attr_init(&attr);
+       pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
+       err = pthread_create(&g_recvthread_id, &attr, recv_thread, NULL);
 
        if (err)
                PRINTMSG("failed to crate recv thread\n");
 
+       pthread_attr_destroy(&attr);
+
        return err;
 }