[Feature][T106]ZXW P56U09 code
Only Configure: Yes
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: No
Doc Update: No
Change-Id: I3cbd8b420271eb20c2b40ebe5c78f83059cd42f3
diff --git a/ap/lib/libdemo/demo.c b/ap/lib/libdemo/demo.c
new file mode 100755
index 0000000..88cf05d
--- /dev/null
+++ b/ap/lib/libdemo/demo.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+static void *thread_func(void *arg)
+{
+ char buffer[10];
+
+ while(1)
+ {
+ printf("thread_func\n");
+ sleep(1);
+ }
+ pthread_exit(0);
+}
+
+int demo_main(void)
+{
+ pthread_attr_t attr;
+ pthread_t tid;
+ int s;
+
+ s = pthread_attr_init(&attr);
+ if (s != 0)
+ {
+ perror("pthread_attr_init error\n");
+ exit(-1);
+ }
+
+
+ s = pthread_create(&tid, &attr, thread_func, NULL);
+ if (s != 0)
+ {
+ perror("pthread_create error\n");
+ exit(-2);
+ }
+
+ s = pthread_join(tid, NULL);
+ if (s != 0)
+ {
+ perror("pthread_join error\n");
+ exit(-3);
+ }
+
+ return 0;
+}