aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-03-29 16:02:13 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-03-29 16:06:33 +0200
commit5fdbf43a0af039c7ad64b9de8038d5d7d9cd0c60 (patch)
tree9e04888fd6adc962ab37647388071929d614011a /src/tests
parent162436f4ffbbf63d867735f7de5b78dcd684f890 (diff)
Add comments
Improves the comments of the module jobs Change-Id: Id99e9c6d6c9572d68ae9cca0f13e2498348de91d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test-thread.c10
-rwxr-xr-xsrc/tests/test-thread.sh2
2 files changed, 4 insertions, 8 deletions
diff --git a/src/tests/test-thread.c b/src/tests/test-thread.c
index 3ed31401..30e27a2e 100644
--- a/src/tests/test-thread.c
+++ b/src/tests/test-thread.c
@@ -73,7 +73,7 @@ void process(struct afb_req req)
void terminate(int signum)
{
printf("---------------- TERMINATE T%d (%d)\n", (int)syscall(SYS_gettid), signum);
-#if 0
+#if 1
jobs_terminate();
#else
jobs_invoke0(0, jobs_terminate);
@@ -97,7 +97,7 @@ int main()
afb_thread_req_call(req, process, 5, (&ts) + (i % 7));
unref(foo);
if (i == 5000)
-#if 1
+#if 0
jobs_invoke0(0, terminate);
#else
jobs_queue0(NULL, 0, terminate);
@@ -106,11 +106,7 @@ int main()
ts.tv_nsec = 1000000;
// nanosleep(&ts, NULL);
}
- ts.tv_sec = 1;
- ts.tv_nsec = 0;
- nanosleep(&ts, NULL);
- jobs_terminate();
- return 0;
+ return -jobs_add_me();
}
diff --git a/src/tests/test-thread.sh b/src/tests/test-thread.sh
index fe73516f..e353e028 100755
--- a/src/tests/test-thread.sh
+++ b/src/tests/test-thread.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cc test-thread.c ../afb-thread.c ../verbose.c ../sig-monitor.c ../jobs.c -o test-thread -lrt -lpthread -I../../include -g -O2
+cc test-thread.c ../afb-thread.c ../verbose.c ../sig-monitor.c ../jobs.c -o test-thread -lrt -lpthread -I../../include -g
./test-thread