mariadb/portability/tests/test-toku-malloc.c
Yoni Fogel 3a208cebc4 closes [t:4913]. Modelines now synchronized in every source/header file (and always top two lines)
git-svn-id: file:///svn/toku/tokudb@43762 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-17 00:00:36 -04:00

28 lines
672 B
C

/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
#include <stdio.h>
#include <toku_assert.h>
#include <memory.h>
#include <toku_pthread.h>
static void *f(void *arg) {
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;
}