Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
slash
Commits
72ba1e6d
Unverified
Commit
72ba1e6d
authored
Jan 29, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: Factor out seglist loading wait
parent
8606e06b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
fellow_cache.c
src/fellow_cache.c
+11
-3
No files found.
src/fellow_cache.c
View file @
72ba1e6d
...
...
@@ -2297,6 +2297,16 @@ fellow_cache_seglists_need(const struct fellow_cache *fc,
AZ(fc->taskrun(fellow_cache_seglists_load, fclsp, &fclsp->state));
}
static void
fellow_cache_seglists_wait_locked(struct fellow_cache_obj *fco)
{
CHECK_OBJ_NOTNULL(fco, FELLOW_CACHE_OBJ_MAGIC);
while (fco->seglstate == SEGL_LOADING)
AZ(pthread_cond_wait(&fco->cond, &fco->mtx));
assert(fco->seglstate == SEGL_DONE || fco->seglstate == SEGL_NEED);
}
/*
* MEM LAYOUT
*
...
...
@@ -3734,9 +3744,7 @@ fellow_cache_obj_slim(const struct fellow_cache *fc,
AZ(pthread_mutex_lock(&fco->mtx));
// we wait for loading complete to be able to ignore pending
while (fco->seglstate == SEGL_LOADING)
AZ(pthread_cond_wait(&fco->cond, &fco->mtx));
assert(fco->seglstate == SEGL_DONE || fco->seglstate == SEGL_NEED);
fellow_cache_seglists_wait_locked(fco);
/* anything to do at all? */
while ((fcs = fcsc_next_ignore_pending(&c)) != 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