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
8e332209
Commit
8e332209
authored
Nov 24, 2000
by
jani@prima.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
81bc313e
2e2b2cf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
0 deletions
+95
-0
Docs/manual.texi
Docs/manual.texi
+6
-0
client/thimble.cc
client/thimble.cc
+89
-0
No files found.
Docs/manual.texi
View file @
8e332209
...
...
@@ -38852,6 +38852,12 @@ Reset status variable which could cause problem if one used @code{--slow-log}.
@appendixsubsec Changes in release 3.23.28
@itemize @bullet
@item
Added new options @code{--pager[=...]}, @code{--no-pager},
@code{--tee=...} and @code{--no-tee} to the @code{mysql} client. The
new corresponding interactive commands are @code{pager}, @code{nopager},
@code{tee} and @code{notee}. @xref{mysql}, @code{mysql --help} and the
interactive help for more information.
@item
Fixed crash when automatic repair of @code{MyISAM} table failed.
@item
Fixed a major performance bug in the table locking code when one
client/thimble.cc
0 → 100644
View file @
8e332209
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static
void
spawn_stern_thread
(
pthread_t
*
t
);
static
int
act_goofy
(
void
);
static
void
*
be_stern
(
void
*
);
static
struct
{
pthread_mutex_t
lock
;
pthread_cond_t
cond
;
int
msg
;
}
comm
=
{
PTHREAD_MUTEX_INITIALIZER
,
PTHREAD_COND_INITIALIZER
,
0
};
int
main
(
void
)
{
pthread_t
t
;
spawn_stern_thread
(
&
t
);
while
(
act_goofy
()
!=
0
)
/* do nothing */
;
pthread_exit
(
NULL
);
/* notreached */
return
EXIT_SUCCESS
;
}
static
void
spawn_stern_thread
(
pthread_t
*
t
)
{
pthread_attr_t
attr
;
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
if
(
pthread_create
(
t
,
&
attr
,
be_stern
,
NULL
)
!=
0
)
exit
(
EXIT_FAILURE
);
pthread_attr_destroy
(
&
attr
);
}
static
int
act_goofy
(
void
)
{
int
ret
;
char
buf
[
30
];
fputs
(
"Are you ready to act goofy (Y/n)? "
,
stdout
);
fflush
(
stdout
);
fgets
(
buf
,
sizeof
(
buf
),
stdin
);
pthread_mutex_lock
(
&
comm
.
lock
);
if
(
buf
[
0
]
==
'y'
||
buf
[
0
]
==
'\n'
)
{
fputs
(
"** Waawlwalkwwwaa!!
\n
"
,
stdout
);
fflush
(
stdout
);
++
comm
.
msg
;
ret
=
1
;
}
else
{
fputs
(
"OK, I hate you. Let me go.
\n
"
,
stdout
);
fflush
(
stdout
);
comm
.
msg
=
-
1
;
ret
=
0
;
}
pthread_mutex_unlock
(
&
comm
.
lock
);
pthread_cond_signal
(
&
comm
.
cond
);
return
ret
;
}
static
void
*
be_stern
(
void
*
v
__attribute
((
unused
)))
{
int
msg
;
for
(;;)
{
pthread_mutex_lock
(
&
comm
.
lock
);
while
(
comm
.
msg
==
0
)
pthread_cond_wait
(
&
comm
.
cond
,
&
comm
.
lock
);
msg
=
comm
.
msg
;
comm
.
msg
=
0
;
pthread_mutex_unlock
(
&
comm
.
lock
);
if
(
msg
<
0
)
break
;
/* the goofy one learned a lesson! */
fputs
(
"I HAVE TO BE STERN WITH YOU!
\n
"
,
stderr
);
fprintf
(
stderr
,
"I should give you %d lashes.
\n
"
,
msg
);
sleep
(
msg
);
}
fputs
(
"You are NOTHING!
\n
"
,
stderr
);
return
NULL
;
}
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