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

#4869 #4753 fixup debug icc build refs[t:4869] refs[t:4753]

git-svn-id: file:///svn/toku/tokudb@43598 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1c247606
...@@ -13,38 +13,34 @@ ...@@ -13,38 +13,34 @@
struct test_seq { struct test_seq {
int state; int state;
toku_pthread_mutex_t lock; toku_mutex_t lock;
toku_pthread_cond_t cv; toku_cond_t cv;
}; };
static void test_seq_init(struct test_seq *seq) { static void test_seq_init(struct test_seq *seq) {
seq->state = 0; seq->state = 0;
int r; toku_mutex_init(&seq->lock, NULL);
r = toku_pthread_mutex_init(&seq->lock, NULL); assert(r == 0); toku_cond_init(&seq->cv, NULL);
r = toku_pthread_cond_init(&seq->cv, NULL); assert(r == 0);
} }
static void test_seq_destroy(struct test_seq *seq) { static void test_seq_destroy(struct test_seq *seq) {
int r; toku_mutex_destroy(&seq->lock);
r = toku_pthread_mutex_destroy(&seq->lock); assert(r == 0); toku_cond_destroy(&seq->cv);
r = toku_pthread_cond_destroy(&seq->cv); assert(r == 0);
} }
static void test_seq_sleep(struct test_seq *seq, int new_state) { static void test_seq_sleep(struct test_seq *seq, int new_state) {
int r; toku_mutex_lock(&seq->lock);
r = toku_pthread_mutex_lock(&seq->lock); assert(r == 0);
while (seq->state != new_state) { while (seq->state != new_state) {
r = toku_pthread_cond_wait(&seq->cv, &seq->lock); assert(r == 0); toku_cond_wait(&seq->cv, &seq->lock);
} }
r = toku_pthread_mutex_unlock(&seq->lock); assert(r == 0); toku_mutex_unlock(&seq->lock);
} }
static void test_seq_next_state(struct test_seq *seq) { static void test_seq_next_state(struct test_seq *seq) {
int r; toku_mutex_lock(&seq->lock);
r = toku_pthread_mutex_lock(&seq->lock);
seq->state++; seq->state++;
r = toku_pthread_cond_broadcast(&seq->cv); assert(r == 0); toku_cond_broadcast(&seq->cv);
r = toku_pthread_mutex_unlock(&seq->lock); assert(r == 0); toku_mutex_unlock(&seq->lock);
} }
struct locker_args { struct locker_args {
......
...@@ -13,38 +13,34 @@ ...@@ -13,38 +13,34 @@
struct test_seq { struct test_seq {
int state; int state;
toku_pthread_mutex_t lock; toku_mutex_t lock;
toku_pthread_cond_t cv; toku_cond_t cv;
}; };
static void test_seq_init(struct test_seq *seq) { static void test_seq_init(struct test_seq *seq) {
seq->state = 0; seq->state = 0;
int r; toku_mutex_init(&seq->lock, NULL);
r = toku_pthread_mutex_init(&seq->lock, NULL); assert(r == 0); toku_cond_init(&seq->cv, NULL);
r = toku_pthread_cond_init(&seq->cv, NULL); assert(r == 0);
} }
static void test_seq_destroy(struct test_seq *seq) { static void test_seq_destroy(struct test_seq *seq) {
int r; toku_mutex_destroy(&seq->lock);
r = toku_pthread_mutex_destroy(&seq->lock); assert(r == 0); toku_cond_destroy(&seq->cv);
r = toku_pthread_cond_destroy(&seq->cv); assert(r == 0);
} }
static void test_seq_sleep(struct test_seq *seq, int new_state) { static void test_seq_sleep(struct test_seq *seq, int new_state) {
int r; toku_mutex_lock(&seq->lock);
r = toku_pthread_mutex_lock(&seq->lock); assert(r == 0);
while (seq->state != new_state) { while (seq->state != new_state) {
r = toku_pthread_cond_wait(&seq->cv, &seq->lock); assert(r == 0); toku_cond_wait(&seq->cv, &seq->lock);
} }
r = toku_pthread_mutex_unlock(&seq->lock); assert(r == 0); toku_mutex_unlock(&seq->lock);
} }
static void test_seq_next_state(struct test_seq *seq) { static void test_seq_next_state(struct test_seq *seq) {
int r; toku_mutex_lock(&seq->lock);
r = toku_pthread_mutex_lock(&seq->lock);
seq->state++; seq->state++;
r = toku_pthread_cond_broadcast(&seq->cv); assert(r == 0); toku_cond_broadcast(&seq->cv);
r = toku_pthread_mutex_unlock(&seq->lock); assert(r == 0); toku_mutex_unlock(&seq->lock);
} }
struct locker_args { struct locker_args {
......
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