Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
0c4bf0e6
Commit
0c4bf0e6
authored
Apr 10, 2014
by
David COME
Browse files
Moved LogContext of DiskWriteThreadPool::WordkingThread to run to a class attribute
Thus, threads' begins and ends are logged with the threadID
parent
3cf199bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskWriteThreadPool.cpp
View file @
0c4bf0e6
...
...
@@ -102,7 +102,7 @@ namespace daemon {
}
void
DiskWriteThreadPool
::
DiskWriteWorkerThread
::
run
()
{
std
::
auto_ptr
<
DiskWriteTaskInterface
>
task
;
castor
::
log
::
LogContext
lc
=
_this
.
m_lc
;
while
(
1
)
{
task
.
reset
(
_this
.
m_tasks
.
pop
());
if
(
NULL
!=
task
.
get
())
{
...
...
@@ -111,7 +111,7 @@ namespace daemon {
}
}
//end of task!=NULL
else
{
log
::
LogContext
::
ScopedParam
(
lc
,
log
::
Param
(
"threadID"
,
threadID
));
log
::
LogContext
::
ScopedParam
param
(
lc
,
log
::
Param
(
"threadID"
,
threadID
));
lc
.
log
(
LOG_INFO
,
"Disk write thread finishing"
);
break
;
}
...
...
castor/tape/tapeserver/daemon/DiskWriteThreadPool.hpp
View file @
0c4bf0e6
...
...
@@ -68,8 +68,11 @@ private:
public:
DiskWriteWorkerThread
(
DiskWriteThreadPool
&
manager
)
:
threadID
(
m_nbActiveThread
++
),
_this
(
manager
)
{}
{
log
::
LogContext
::
ScopedParam
param
(
lc
,
log
::
Param
(
"threadID"
,
threadID
));
lc
.
log
(
LOG_INFO
,
"DiskWrite Thread created"
);
}
void
startThreads
()
{
start
();
}
void
waitThreads
()
{
wait
();
}
private:
...
...
@@ -78,7 +81,7 @@ private:
static
tape
::
threading
::
AtomicCounter
<
int
>
failledWritting
;
const
int
threadID
;
DiskWriteThreadPool
&
_this
;
castor
::
log
::
LogContext
lc
;
virtual
void
run
();
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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