1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00
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:
unknown
2006-01-12 12:27:25 -08:00
parent d6b565ef35
commit 88ece282f5
4 changed files with 25 additions and 1087 deletions

View File

@@ -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;