myMPD
Internal API documentation
Loading...
Searching...
No Matches
cache_rax.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-3.0-or-later
3 myMPD (c) 2018-2026 Juergen Mang <mail@jcgames.de>
4 https://github.com/jcorporation/mympd
5*/
6
10
11#ifndef MYMPD_CACHE_RAX_H
12#define MYMPD_CACHE_RAX_H
13
14#include "dist/rax/rax.h"
15
16#include <pthread.h>
17#include <stdbool.h>
18
22struct t_cache {
23 bool building;
24 rax *cache;
25 pthread_rwlock_t rwlock;
26 time_t mtime;
27};
28
29bool cache_init(struct t_cache *cache);
30bool cache_free(struct t_cache *cache);
31
32bool cache_get_read_lock(struct t_cache *cache);
33bool cache_get_write_lock(struct t_cache *cache);
34bool cache_release_lock(struct t_cache *cache);
35
36#endif
bool cache_get_write_lock(struct t_cache *cache)
Definition cache_rax.c:70
bool cache_get_read_lock(struct t_cache *cache)
Definition cache_rax.c:54
bool cache_init(struct t_cache *cache)
Definition cache_rax.c:20
bool cache_release_lock(struct t_cache *cache)
Definition cache_rax.c:86
bool cache_free(struct t_cache *cache)
Definition cache_rax.c:38
Definition cache_rax.h:22
pthread_rwlock_t rwlock
pthreads read-write lock object
Definition cache_rax.h:25
time_t mtime
modification time
Definition cache_rax.h:26
rax * cache
pointer to the cache
Definition cache_rax.h:24
bool building
true if the mympd_worker thread is creating the cache
Definition cache_rax.h:23