Skip to content

Commit

Permalink
Yield cache mutex during cache updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Sep 27, 2016
1 parent 5e5ce58 commit 92c482c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ struct track_info **cache_refresh(int *count, int force)
struct stat st;
int rc = 0;

cache_yield();

/*
* If no-one else has reference to tis[i] then it is set to NULL
* otherwise:
Expand Down
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
extern struct fifo_mutex cache_mutex;

#define cache_lock() fifo_mutex_lock(&cache_mutex)
#define cache_yield() fifo_mutex_yield(&cache_mutex)
#define cache_unlock() fifo_mutex_unlock(&cache_mutex)

int cache_init(void);
Expand Down

0 comments on commit 92c482c

Please sign in to comment.