X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Floadtest.c;h=d24977ccd33efef2bdd16e8e184448652acac8ef;hb=9ed44fccc6348245f49d82907c5aca52b5b9ad73;hp=0f5920ab4c08adcc92fb91cafc1e4907cce6d716;hpb=de228221fd04ebff551c7e92e0b6beccecb637ff;p=citadel.git diff --git a/citadel/utils/loadtest.c b/citadel/utils/loadtest.c index 0f5920ab4..d24977ccd 100644 --- a/citadel/utils/loadtest.c +++ b/citadel/utils/loadtest.c @@ -275,10 +275,12 @@ void perform_random_thing(int serv_sock) { // This is the main loop. We log in as the load test user, and then perform random operations until stopped. -void *loadtest(void *blah) { +void *loadtest(void *pointer_to_thread_id) { char buf[SIZ]; int serv_sock; + int thread_id = *(int *)pointer_to_thread_id; + serv_sock = uds_connectsock(file_citadel_socket); if (serv_sock < 0) { @@ -299,8 +301,8 @@ void *loadtest(void *blah) { serv_gets(serv_sock, buf); // Find a nice spot on the screen to show the operation count for this thread. - int row = 10 + ((serv_sock-3) % 20); - int col = ((serv_sock-3) / 20) * 10; + int row = 10 + (thread_id % 20); + int col = (thread_id / 20) * 10; long ops = 0; printf("\033[%d;%dH\033[33m 0\033[0m", row, col); fflush(stdout); @@ -384,7 +386,7 @@ int main(int argc, char **argv) { for (i=0; i