diff options
author | Brian Behlendorf <[email protected]> | 2009-07-14 14:34:36 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-07-14 14:34:36 -0700 |
commit | 6923d172c5efdfb5bdefb17ab4a0de64b54aaf05 (patch) | |
tree | a83d0607baa5eb2a9396229f782b85322841b905 /cmd | |
parent | 151315f7cbe5476ec3591aa2d9538969b1538eb9 (diff) | |
parent | 605a50131111bda41452dc505e8d10cac3020f54 (diff) |
Merge commit 'refs/top-bases/feature-branch' into feature-branch
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/ztest/ztest.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index facb2354a..e171e91de 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -141,6 +141,7 @@ typedef struct ztest_args { objset_t *za_os; zilog_t *za_zilog; kthread_t *za_thread; + kt_did_t za_threadid; uint64_t za_instance; uint64_t za_random; uint64_t za_diroff; @@ -3806,6 +3807,8 @@ ztest_resume_thread(void *arg) (void) poll(NULL, 0, 1000); ztest_resume(spa); } + + thread_exit(); return (NULL); } @@ -3870,6 +3873,7 @@ ztest_thread(void *arg) break; } + thread_exit(); return (NULL); } @@ -3885,6 +3889,7 @@ ztest_run(char *pool) spa_t *spa; char name[100]; kthread_t *resume_thread; + kt_did_t resume_id; ztest_exiting = B_FALSE; @@ -3963,8 +3968,9 @@ ztest_run(char *pool) /* * Create a thread to periodically resume suspended I/O. */ - resume_thread = thread_create(NULL, 0, ztest_resume_thread, spa, - THR_BOUND, NULL, 0, 0); + VERIFY3P((resume_thread = thread_create(NULL, 0, ztest_resume_thread, + spa, THR_BOUND, NULL, 0, 0)), !=, NULL); + resume_id = resume_thread->t_tid; /* * Verify that we can safely inquire about about any object, @@ -4040,12 +4046,13 @@ ztest_run(char *pool) za[d].za_zilog = zil_open(za[d].za_os, NULL); } - za[t].za_thread = thread_create(NULL, 0, ztest_thread, &za[t], - THR_BOUND, NULL, 0, 0); + VERIFY3P((za[t].za_thread = thread_create(NULL, 0, ztest_thread, + &za[t], THR_BOUND, NULL, 0, 0)), !=, NULL); + za[t].za_threadid = za[t].za_thread->t_tid; } while (--t >= 0) { - VERIFY(thr_join(za[t].za_thread, NULL, NULL) == 0); + VERIFY(thread_join(za[t].za_threadid, NULL, NULL) == 0); if (t < zopt_datasets) { zil_close(za[t].za_zilog); dmu_objset_close(za[t].za_os); @@ -4084,7 +4091,7 @@ ztest_run(char *pool) /* Kill the resume thread */ ztest_exiting = B_TRUE; - VERIFY(thr_join(resume_thread, NULL, NULL) == 0); + VERIFY(thread_join(resume_id, NULL, NULL) == 0); ztest_resume(spa); /* |