mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed bug #16167
Added --use-threads option for porting to Windows. client/mysqlslap.c: Addinng thread option for porting to windows (second piece of code) Also added flush call to fix one bug mysql-test/r/mysqlslap.result: New results mysql-test/t/disabled.def: Bug 16167 should not be fixed mysql-test/t/mysqlslap.test: Added test for new use-threads option
This commit is contained in:
@@ -982,6 +982,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
|
||||
}
|
||||
else
|
||||
{
|
||||
fflush(NULL);
|
||||
for (x= 0; x < concur; x++)
|
||||
{
|
||||
int pid;
|
||||
@@ -1026,10 +1027,19 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
|
||||
|
||||
gettimeofday(&start_time, NULL);
|
||||
|
||||
my_close(lock_file, MYF(0));
|
||||
|
||||
/*
|
||||
We look to grab a write lock at this point. Once we get it we know that
|
||||
all clients have completed their work.
|
||||
*/
|
||||
if (opt_use_threads)
|
||||
{
|
||||
if (my_lock(lock_file, F_WRLCK, 0, F_TO_EOF, MYF(0)))
|
||||
{
|
||||
fprintf(stderr,"%s: Could not get lockfile\n",
|
||||
my_progname);
|
||||
exit(0);
|
||||
}
|
||||
my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1043,6 +1053,8 @@ WAIT:
|
||||
}
|
||||
gettimeofday(&end_time, NULL);
|
||||
|
||||
my_close(lock_file, MYF(0));
|
||||
|
||||
sptr->timing= timedif(end_time, start_time);
|
||||
sptr->users= concur;
|
||||
sptr->rows= limit;
|
||||
|
Reference in New Issue
Block a user