Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix bug in recycling jobs
[src/app-framework-binder.git]
/
src
/
tests
/
test-thread.c
diff --git
a/src/tests/test-thread.c
b/src/tests/test-thread.c
index
cc676bd
..
2f0e185
100644
(file)
--- a/
src/tests/test-thread.c
+++ b/
src/tests/test-thread.c
@@
-7,6
+7,7
@@
#include <afb/afb-req-itf.h>
#include "../afb-thread.h"
#include <afb/afb-req-itf.h>
#include "../afb-thread.h"
+#include "../jobs.h"
struct foo {
int value;
struct foo {
int value;
@@
-77,12
+78,12
@@
int main()
struct timespec ts;
req.itf = &itf;
struct timespec ts;
req.itf = &itf;
-
afb_thread_init(4, 1
);
+
jobs_init(4, 0, 20000
);
for (i = 0 ; i < 10000 ; i++) {
req.closure = foo = malloc(sizeof *foo);
foo->value = i;
foo->refcount = 1;
for (i = 0 ; i < 10000 ; i++) {
req.closure = foo = malloc(sizeof *foo);
foo->value = i;
foo->refcount = 1;
- afb_thread_
call(req, process, 5, (&ts) + (i % 4
));
+ afb_thread_
req_call(req, process, 5, (&ts) + (i % 7
));
unref(foo);
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
unref(foo);
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
@@
-91,7
+92,7
@@
int main()
ts.tv_sec = 1;
ts.tv_nsec = 0;
nanosleep(&ts, NULL);
ts.tv_sec = 1;
ts.tv_nsec = 0;
nanosleep(&ts, NULL);
-
afb_thread
_terminate();
+
jobs
_terminate();
}
}