Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
0bd618ec
Commit
0bd618ec
authored
Mar 27, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid taking reopen_lock for every write
parent
bd71d41f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
writer.c
src/writer.c
+8
-3
No files found.
src/writer.c
View file @
0bd618ec
...
@@ -185,10 +185,14 @@ wrt_write(tx_t *tx)
...
@@ -185,10 +185,14 @@ wrt_write(tx_t *tx)
CHECK_OBJ_NOTNULL
(
tx
,
TX_MAGIC
);
CHECK_OBJ_NOTNULL
(
tx
,
TX_MAGIC
);
assert
(
tx
->
state
==
TX_SUBMITTED
);
assert
(
tx
->
state
==
TX_SUBMITTED
);
AZ
(
pthread_mutex_lock
(
&
reopen_lock
));
while
(
reopen
&&
fo
!=
stdout
)
{
if
(
reopen
&&
fo
!=
stdout
)
{
int
errnum
;
int
errnum
;
AZ
(
pthread_mutex_lock
(
&
reopen_lock
));
if
(
!
reopen
)
{
AZ
(
pthread_mutex_unlock
(
&
reopen_lock
));
break
;
}
wrt_return_freelist
();
wrt_return_freelist
();
if
(
fflush
(
fo
)
!=
0
)
if
(
fflush
(
fo
)
!=
0
)
LOG_Log
(
LOG_ERR
,
"Cannot flush to %s, DATA DISCARDED: %s"
,
LOG_Log
(
LOG_ERR
,
"Cannot flush to %s, DATA DISCARDED: %s"
,
...
@@ -204,8 +208,9 @@ wrt_write(tx_t *tx)
...
@@ -204,8 +208,9 @@ wrt_write(tx_t *tx)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
reopen
=
0
;
reopen
=
0
;
AZ
(
pthread_mutex_unlock
(
&
reopen_lock
));
break
;
}
}
AZ
(
pthread_mutex_unlock
(
&
reopen_lock
));
VRMB
();
VRMB
();
os
=
FMT_Format
(
tx
,
&
len
);
os
=
FMT_Format
(
tx
,
&
len
);
...
...
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