Commit d111c19d authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4440 fix arg to pthread_create refs[t:4440]

git-svn-id: file:///svn/toku/tokudb@39218 c7de825b-a66e-492c-adef-691d508d4ae1
parent 99f483bd
......@@ -120,8 +120,8 @@ static void *blocking_c_del_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_c_del_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_c_del_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_c_del_thread, &a); assert(r == 0);
}
blocking_c_del(db_env, db, nrows, sleeptime);
......
......@@ -118,8 +118,8 @@ static void *blocking_c_del_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_c_del_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_c_del_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_c_del_thread, &a); assert(r == 0);
}
blocking_c_del(db_env, db, nrows, sleeptime);
......
......@@ -74,8 +74,8 @@ static void *blocking_first_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_first_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_first_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_first_thread, &a); assert(r == 0);
}
blocking_first(db_env, db, nrows, sleeptime);
......
......@@ -91,8 +91,8 @@ static void *blocking_first_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_first_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_first_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_first_thread, &a); assert(r == 0);
}
blocking_first(db_env, db, nrows, sleeptime);
......
......@@ -91,8 +91,8 @@ static void *blocking_last_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_last_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_last_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_last_thread, &a); assert(r == 0);
}
blocking_last(db_env, db, nrows, sleeptime);
......
......@@ -160,8 +160,8 @@ static void *blocking_next_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_next_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_next_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_next_thread, &a); assert(r == 0);
}
blocking_prev(db_env, db, nrows, sleeptime);
......
......@@ -159,8 +159,8 @@ static void *blocking_next_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_next_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_next_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_next_thread, &a); assert(r == 0);
}
blocking_prev(db_env, db, nrows, sleeptime);
......
......@@ -110,8 +110,8 @@ int test_main(int argc, char * const argv[]) {
r = db->open(db, NULL, db_filename, NULL, DB_BTREE, DB_CREATE|DB_AUTO_COMMIT|DB_THREAD, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
toku_pthread_t tids[nthreads];
struct blocking_range_lock_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_range_lock_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_range_lock_thread, &a); assert(r == 0);
}
blocking_range_lock(db_env, db, nrows, sleeptime);
......
......@@ -139,13 +139,15 @@ int test_main(int argc, char * const argv[]) {
r = db_env->get_timeout(db_env, &t, DB_SET_TXN_TIMEOUT); assert(r == 0);
if (verbose) printf("txn %d\n", t);
r = db_env->set_timeout(db_env, 5, DB_SET_LOCK_TIMEOUT); assert(r == 0);
r = db_env->set_timeout(db_env, 5, DB_SET_TXN_TIMEOUT); assert(r == 0);
r = db_env->set_timeout(db_env, 5000000, DB_SET_LOCK_TIMEOUT); assert(r == 0);
r = db_env->set_timeout(db_env, 5000000, DB_SET_TXN_TIMEOUT); assert(r == 0);
r = db_env->get_timeout(db_env, &t, DB_SET_LOCK_TIMEOUT); assert(r == 0);
if (verbose) printf("lock %d\n", t);
r = db_env->get_timeout(db_env, &t, DB_SET_TXN_TIMEOUT); assert(r == 0);
if (verbose) printf("txn %d\n", t);
r = db_env->set_lk_detect(db_env, DB_LOCK_EXPIRE); assert(r == 0);
#endif
#if USE_TDB
uint64_t lock_timeout_msec;
......
......@@ -109,8 +109,8 @@ int test_main(int argc, char * const argv[]) {
r = db->open(db, NULL, db_filename, NULL, DB_BTREE, DB_CREATE|DB_AUTO_COMMIT|DB_THREAD, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
toku_pthread_t tids[nthreads];
struct blocking_put_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_put_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_put_thread, &a); assert(r == 0);
}
blocking_put(db_env, db, nrows, sleeptime);
......
......@@ -101,8 +101,8 @@ static void *blocking_set_range_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime, uint64_t the_key) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
r = toku_pthread_create(&tids[i], NULL, blocking_set_range_thread, &a); assert(r == 0);
}
blocking_set_range(db_env, db, nrows, sleeptime, the_key);
......
......@@ -96,8 +96,8 @@ static void *blocking_set_range_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime, uint64_t the_key) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
r = toku_pthread_create(&tids[i], NULL, blocking_set_range_thread, &a); assert(r == 0);
}
blocking_set_range(db_env, db, nrows, sleeptime, the_key);
......
......@@ -99,8 +99,8 @@ static void *blocking_set_range_thread(void *arg) {
static void run_test(DB_ENV *db_env, DB *db, int nthreads, uint64_t nrows, long sleeptime, uint64_t the_key) {
int r;
toku_pthread_t tids[nthreads];
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_set_range_args a = { db_env, db, nrows, sleeptime, the_key };
r = toku_pthread_create(&tids[i], NULL, blocking_set_range_thread, &a); assert(r == 0);
}
blocking_set_range(db_env, db, nrows, sleeptime, the_key);
......
......@@ -157,8 +157,8 @@ int test_main(int argc, char * const argv[]) {
populate(db_env, db, nrows);
toku_pthread_t tids[nthreads];
struct blocking_set_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_set_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_set_thread, &a); assert(r == 0);
}
blocking_set(db_env, db, nrows, sleeptime);
......
......@@ -103,8 +103,8 @@ int test_main(int argc, char * const argv[]) {
r = db->open(db, NULL, db_filename, NULL, DB_BTREE, DB_CREATE|DB_AUTO_COMMIT|DB_THREAD, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
toku_pthread_t tids[nthreads];
struct blocking_table_lock_args a = { db_env, db, nrows, sleeptime };
for (int i = 0; i < nthreads-1; i++) {
struct blocking_table_lock_args a = { db_env, db, nrows, sleeptime };
r = toku_pthread_create(&tids[i], NULL, blocking_table_lock_thread, &a); assert(r == 0);
}
blocking_table_lock(db_env, db, nrows, sleeptime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment