2013-04-16 23:57:35 -04:00
|
|
|
#include <stdio.h>
|
2013-04-16 23:58:56 -04:00
|
|
|
#include <toku_assert.h>
|
2013-04-16 23:57:35 -04:00
|
|
|
#include <memory.h>
|
|
|
|
#include <toku_pthread.h>
|
|
|
|
|
2013-04-16 23:57:43 -04:00
|
|
|
static void *f(void *arg) {
|
2013-04-16 23:57:35 -04:00
|
|
|
void *vp = toku_malloc(32);
|
|
|
|
assert(vp);
|
|
|
|
toku_free(vp);
|
|
|
|
return arg;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
int r;
|
|
|
|
int i;
|
|
|
|
const int max_threads = 2;
|
|
|
|
toku_pthread_t tids[max_threads];
|
|
|
|
for (i=0; i<max_threads; i++) {
|
|
|
|
r = toku_pthread_create(&tids[i], NULL, f, 0); assert(r == 0);
|
|
|
|
}
|
|
|
|
for (i=0; i<max_threads; i++) {
|
|
|
|
void *ret;
|
|
|
|
r = toku_pthread_join(tids[i], &ret); assert(r == 0);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|