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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2920f929
Commit
2920f929
authored
Feb 04, 2008
by
pekka@sama.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#34169 - fix pthread_t abuse
parent
256f6e31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
ndb/src/ndbapi/Ndb.cpp
ndb/src/ndbapi/Ndb.cpp
+1
-5
ndb/test/ndbapi/testOIBasic.cpp
ndb/test/ndbapi/testOIBasic.cpp
+4
-5
No files found.
ndb/src/ndbapi/Ndb.cpp
View file @
2920f929
...
@@ -1466,11 +1466,7 @@ Ndb::printState(const char* fmt, ...)
...
@@ -1466,11 +1466,7 @@ Ndb::printState(const char* fmt, ...)
NdbMutex_Lock
(
ndb_print_state_mutex
);
NdbMutex_Lock
(
ndb_print_state_mutex
);
bool
dups
=
false
;
bool
dups
=
false
;
unsigned
i
;
unsigned
i
;
ndbout
<<
buf
<<
" ndb="
<<
hex
<<
this
<<
dec
;
ndbout
<<
buf
<<
" ndb="
<<
hex
<<
(
void
*
)
this
<<
endl
;
#ifndef NDB_WIN32
ndbout
<<
" thread="
<<
(
int
)
pthread_self
();
#endif
ndbout
<<
endl
;
for
(
unsigned
n
=
0
;
n
<
MAX_NDB_NODES
;
n
++
)
{
for
(
unsigned
n
=
0
;
n
<
MAX_NDB_NODES
;
n
++
)
{
NdbTransaction
*
con
=
theConnectionArray
[
n
];
NdbTransaction
*
con
=
theConnectionArray
[
n
];
if
(
con
!=
0
)
{
if
(
con
!=
0
)
{
...
...
ndb/test/ndbapi/testOIBasic.cpp
View file @
2920f929
...
@@ -4909,7 +4909,7 @@ struct Thr {
...
@@ -4909,7 +4909,7 @@ struct Thr {
enum
State
{
Wait
,
Start
,
Stop
,
Exit
};
enum
State
{
Wait
,
Start
,
Stop
,
Exit
};
State
m_state
;
State
m_state
;
Par
m_par
;
Par
m_par
;
Uint64
m_id
;
pthread_t
m_id
;
NdbThread
*
m_thread
;
NdbThread
*
m_thread
;
NdbMutex
*
m_mutex
;
NdbMutex
*
m_mutex
;
NdbCondition
*
m_cond
;
NdbCondition
*
m_cond
;
...
@@ -4945,7 +4945,6 @@ struct Thr {
...
@@ -4945,7 +4945,6 @@ struct Thr {
Thr
::
Thr
(
Par
par
,
uint
n
)
:
Thr
::
Thr
(
Par
par
,
uint
n
)
:
m_state
(
Wait
),
m_state
(
Wait
),
m_par
(
par
),
m_par
(
par
),
m_id
(
0
),
m_thread
(
0
),
m_thread
(
0
),
m_mutex
(
0
),
m_mutex
(
0
),
m_cond
(
0
),
m_cond
(
0
),
...
@@ -4987,7 +4986,7 @@ static void*
...
@@ -4987,7 +4986,7 @@ static void*
runthread
(
void
*
arg
)
runthread
(
void
*
arg
)
{
{
Thr
&
thr
=
*
(
Thr
*
)
arg
;
Thr
&
thr
=
*
(
Thr
*
)
arg
;
thr
.
m_id
=
(
Uint64
)
pthread_self
();
thr
.
m_id
=
pthread_self
();
if
(
thr
.
run
()
<
0
)
{
if
(
thr
.
run
()
<
0
)
{
LL1
(
"exit on error"
);
LL1
(
"exit on error"
);
}
else
{
}
else
{
...
@@ -5069,11 +5068,11 @@ static Thr*
...
@@ -5069,11 +5068,11 @@ static Thr*
getthr
()
getthr
()
{
{
if
(
g_thrlist
!=
0
)
{
if
(
g_thrlist
!=
0
)
{
Uint64
id
=
(
Uint64
)
pthread_self
();
pthread_t
id
=
pthread_self
();
for
(
uint
n
=
0
;
n
<
g_opt
.
m_threads
;
n
++
)
{
for
(
uint
n
=
0
;
n
<
g_opt
.
m_threads
;
n
++
)
{
if
(
g_thrlist
[
n
]
!=
0
)
{
if
(
g_thrlist
[
n
]
!=
0
)
{
Thr
&
thr
=
*
g_thrlist
[
n
];
Thr
&
thr
=
*
g_thrlist
[
n
];
if
(
thr
.
m_id
==
id
)
if
(
pthread_equal
(
thr
.
m_id
,
id
)
)
return
&
thr
;
return
&
thr
;
}
}
}
}
...
...
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