diff options
author | Sergei Golubchik <serg@mysql.com> | 2008-07-29 16:10:24 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2008-07-29 16:10:24 +0200 |
commit | cca54d3e69b1b07ca49c83f0e93eb74cc3cca63f (patch) | |
tree | 8fc9687df3d7995af94f6a6df09bc646da26592e /storage/maria/unittest/trnman-t.c | |
parent | 8848f6bd2853753e38125bc721a1a68c8c086744 (diff) | |
download | mariadb-git-cca54d3e69b1b07ca49c83f0e93eb74cc3cca63f.tar.gz |
WL#3064 - waiting threads - wait-for graph and deadlock detection
client/mysqltest.c:
compiler warnings
configure.in:
remove old tests for unused programs
disable the use of gcc built-ins if smp assembler atomics were selected explictily.
add waiting_threads.o to THREAD_LOBJECTS
include/lf.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
include/my_pthread.h:
shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
several timeout structures with only one my_getsystime() call
include/waiting_threads.h:
waiting threads - wait-for graph and deadlock detection
mysys/Makefile.am:
add waiting_threads.c
mysys/lf_alloc-pin.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
mysys/lf_hash.c:
constructor/destructor in lf-alloc
mysys/my_thr_init.c:
remember end-of-stack pointer in the mysys_var
mysys/waiting_threads.c:
waiting threads - wait-for graph and deadlock detection
storage/maria/ha_maria.cc:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/ma_commit.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman_public.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/unittest/trnman-t.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
unittest/mysys/Makefile.am:
add waiting_threads-t
unittest/mysys/lf-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/my_atomic-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/thr_template.c:
factor out the common code for multi-threaded stress unit tests
unittest/mysys/waiting_threads-t.c:
wt tests
Diffstat (limited to 'storage/maria/unittest/trnman-t.c')
-rw-r--r-- | storage/maria/unittest/trnman-t.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/maria/unittest/trnman-t.c b/storage/maria/unittest/trnman-t.c index 439df10e66e..0873761c0a2 100644 --- a/storage/maria/unittest/trnman-t.c +++ b/storage/maria/unittest/trnman-t.c @@ -42,6 +42,8 @@ pthread_handler_t test_trnman(void *arg) pthread_cond_t conds[MAX_ITER]; int m= (*(int *)arg); + my_thread_init(); + for (i= 0; i < MAX_ITER; i++) { pthread_mutex_init(&mutexes[i], MY_MUTEX_INIT_FAST); @@ -54,7 +56,7 @@ pthread_handler_t test_trnman(void *arg) m-= n= x % MAX_ITER; for (i= 0; i < n; i++) { - trn[i]= trnman_new_trn(&mutexes[i], &conds[i], &m + STACK_SIZE); + trn[i]= trnman_new_trn(&mutexes[i], &conds[i]); if (!trn[i]) { diag("trnman_new_trn() failed"); @@ -76,6 +78,8 @@ pthread_handler_t test_trnman(void *arg) rt_num_threads--; pthread_mutex_unlock(&rt_mutex); + my_thread_end(); + return 0; } #undef MAX_ITER @@ -114,7 +118,7 @@ void run_test(const char *test, pthread_handler handler, int n, int m) i= trnman_can_read_from(trn[T1], trid[T2]); \ ok(i == RES, "trn" #T1 " %s read from trn" #T2, i ? "can" : "cannot") #define start_transaction(T) \ - trn[T]= trnman_new_trn(&mutexes[T], &conds[T], &i + STACK_SIZE); \ + trn[T]= trnman_new_trn(&mutexes[T], &conds[T]); \ trid[T]= trn[T]->trid #define commit(T) trnman_commit_trn(trn[T]) #define abort(T) trnman_abort_trn(trn[T]) @@ -159,7 +163,6 @@ void test_trnman_read_from() int main(int argc __attribute__((unused)), char **argv) { MY_INIT(argv[0]); - my_init(); plan(7); |