Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
1a1430c1
Commit
1a1430c1
authored
Oct 07, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Direct cypclass contention locks to stderr and fix unprotected logging
parent
1f7cf860
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+11
-9
No files found.
Cython/Utility/CyObjects.cpp
View file @
1a1430c1
...
...
@@ -578,15 +578,15 @@ void CyLock::rlock(const char *context) {
#else
pid_t
owner_id
=
this
->
owner_id
;
pthread_mutex_lock
(
&
(
CyLock
::
log_guard
));
std
::
c
out
std
::
c
err
<<
"Data Race between [this] reader #"
<<
caller_id
<<
" and [other] writer #"
<<
owner_id
<<
" on lock "
<<
this
<<
std
::
endl
;
if
(
context
!=
NULL
)
{
std
::
c
out
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
std
::
c
err
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
}
if
(
this
->
owner_context
!=
NULL
)
{
std
::
c
out
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
std
::
c
err
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
}
pthread_mutex_unlock
(
&
(
CyLock
::
log_guard
));
#endif
...
...
@@ -676,16 +676,18 @@ void CyLock::wlock(const char *context) {
}
throw
std
::
runtime_error
(
msg
.
str
());
#else
std
::
cout
pthread_mutex_lock
(
&
(
CyLock
::
log_guard
));
std
::
cerr
<<
"Data Race between [this] writer #"
<<
caller_id
<<
" and [other] reader #"
<<
owner_id
<<
" on lock "
<<
this
<<
std
::
endl
;
if
(
context
!=
NULL
)
{
std
::
c
out
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
std
::
c
err
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
}
if
(
this
->
owner_context
!=
NULL
)
{
std
::
c
out
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
std
::
c
err
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
}
pthread_mutex_unlock
(
&
(
CyLock
::
log_guard
));
#endif
}
...
...
@@ -709,15 +711,15 @@ void CyLock::wlock(const char *context) {
throw
std
::
runtime_error
(
msg
.
str
());
#else
pthread_mutex_lock
(
&
(
CyLock
::
log_guard
));
std
::
c
out
std
::
c
err
<<
"Data Race between [this] writer #"
<<
caller_id
<<
" and [other] writer #"
<<
owner_id
<<
" on lock "
<<
this
<<
std
::
endl
;
if
(
context
!=
NULL
)
{
std
::
c
out
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
std
::
c
err
<<
"In [this] context: "
<<
context
<<
std
::
endl
;
}
if
(
this
->
owner_context
!=
NULL
)
{
std
::
c
out
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
std
::
c
err
<<
"In [other] context: "
<<
this
->
owner_context
<<
std
::
endl
;
}
pthread_mutex_unlock
(
&
(
CyLock
::
log_guard
));
#endif
...
...
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