Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
786f9de9
Commit
786f9de9
authored
Mar 16, 2007
by
brian@zim.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of prototype for windows.
parent
e246cb3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
client/mysqlslap.c
client/mysqlslap.c
+11
-9
No files found.
client/mysqlslap.c
View file @
786f9de9
...
@@ -248,7 +248,7 @@ static int create_schema(MYSQL *mysql, const char *db, statement *stmt,
...
@@ -248,7 +248,7 @@ static int create_schema(MYSQL *mysql, const char *db, statement *stmt,
option_string
*
engine_stmt
);
option_string
*
engine_stmt
);
static
int
run_scheduler
(
stats
*
sptr
,
statement
*
stmts
,
uint
concur
,
static
int
run_scheduler
(
stats
*
sptr
,
statement
*
stmts
,
uint
concur
,
ulonglong
limit
);
ulonglong
limit
);
int
run_task
(
thread_context
*
con
);
pthread_handler_t
run_task
(
void
*
p
);
void
statement_cleanup
(
statement
*
stmt
);
void
statement_cleanup
(
statement
*
stmt
);
void
option_cleanup
(
option_string
*
stmt
);
void
option_cleanup
(
option_string
*
stmt
);
void
concurrency_loop
(
MYSQL
*
mysql
,
uint
current
,
option_string
*
eptr
);
void
concurrency_loop
(
MYSQL
*
mysql
,
uint
current
,
option_string
*
eptr
);
...
@@ -1562,6 +1562,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
...
@@ -1562,6 +1562,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
pthread_t
mainthread
;
/* Thread descriptor */
pthread_t
mainthread
;
/* Thread descriptor */
pthread_attr_t
attr
;
/* Thread attributes */
pthread_attr_t
attr
;
/* Thread attributes */
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
pthread_mutex_lock
(
&
counter_mutex
);
pthread_mutex_lock
(
&
counter_mutex
);
thread_counter
=
0
;
thread_counter
=
0
;
...
@@ -1570,12 +1575,8 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
...
@@ -1570,12 +1575,8 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
pthread_mutex_unlock
(
&
sleeper_mutex
);
pthread_mutex_unlock
(
&
sleeper_mutex
);
for
(
x
=
0
;
x
<
concur
;
x
++
)
for
(
x
=
0
;
x
<
concur
;
x
++
)
{
{
pthread_attr_init
(
&
attr
);
/* nowucreate the thread */
pthread_attr_setdetachstate
(
&
attr
,
if
(
pthread_create
(
&
mainthread
,
&
attr
,
run_task
,
PTHREAD_CREATE_DETACHED
);
/* now create the thread */
if
(
pthread_create
(
&
mainthread
,
&
attr
,
(
void
*
)
run_task
,
(
void
*
)
&
con
)
!=
0
)
(
void
*
)
&
con
)
!=
0
)
{
{
fprintf
(
stderr
,
"%s: Could not create thread
\n
"
,
fprintf
(
stderr
,
"%s: Could not create thread
\n
"
,
...
@@ -1605,6 +1606,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
...
@@ -1605,6 +1606,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
pthread_cond_timedwait
(
&
count_threshhold
,
&
counter_mutex
,
&
abstime
);
pthread_cond_timedwait
(
&
count_threshhold
,
&
counter_mutex
,
&
abstime
);
}
}
pthread_mutex_unlock
(
&
counter_mutex
);
pthread_mutex_unlock
(
&
counter_mutex
);
pthread_attr_destroy
(
&
attr
);
gettimeofday
(
&
end_time
,
NULL
);
gettimeofday
(
&
end_time
,
NULL
);
...
@@ -1617,14 +1619,14 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
...
@@ -1617,14 +1619,14 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
}
}
int
pthread_handler_t
run_task
(
void
*
p
)
run_task
(
thread_context
*
con
)
{
{
ulonglong
counter
=
0
,
queries
;
ulonglong
counter
=
0
,
queries
;
MYSQL
*
mysql
;
MYSQL
*
mysql
;
MYSQL_RES
*
result
;
MYSQL_RES
*
result
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
statement
*
ptr
;
statement
*
ptr
;
thread_context
*
con
=
(
thread_context
*
)
p
;
DBUG_ENTER
(
"run_task"
);
DBUG_ENTER
(
"run_task"
);
DBUG_PRINT
(
"info"
,
(
"task script
\"
%s
\"
"
,
con
->
stmt
?
con
->
stmt
->
string
:
""
));
DBUG_PRINT
(
"info"
,
(
"task script
\"
%s
\"
"
,
con
->
stmt
?
con
->
stmt
->
string
:
""
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment