diff options
author | Chris Mason <clm@fb.com> | 2020-04-16 11:12:05 -0700 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2020-04-16 11:12:05 -0700 |
commit | 691e47dc6f9f4bb883b78b45a8a42bfee9a5526c (patch) | |
tree | ff70881c5879eb642ca96efcf479dc04a4716919 | |
parent | 7011f12b89d17a3191d1d11e3cc39929438bcd9d (diff) | |
download | simoop-691e47dc6f9f4bb883b78b45a8a42bfee9a5526c.tar.gz |
simoop: honor stopping in more places
This helps make sure we actually stop on time.
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | simoop.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1178,6 +1178,9 @@ static void write_pattern(int fd, void *xxhash_state, char *buf, aligned_start += this_write; length -= this_write; + + if (stopping) + break; } } @@ -1225,6 +1228,9 @@ static void read_and_crc(int fd, char *filename, } aligned_start += this_read; length -= this_read; + + if (stopping) + break; } } @@ -1584,11 +1590,13 @@ void *read_thread(void *arg) int i; char *buf = arg; - for (i = 0; i < 4; i++) { + for (i = 0; i < 128; i++) { int index = rand() % total_paths; int seq = rand() % num_files; char *path = paths[index]; read_from_file(path, seq, buf); + if (stopping) + break; } return NULL; } @@ -1616,11 +1624,13 @@ void *write_thread(void *arg) char *buf = arg; int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < 128; i++) { int index = rand() % total_paths; int seq = rand() % num_files; char *path = paths[index]; write_to_file(path, seq, buf); + if (stopping) + break; } return NULL; } |