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-2025 Juergen Mang <mail@jcgames.de>
4 https://github.com/jcorporation/mympd
5*/
6
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};
27
28bool cache_init(struct t_cache *cache);
29bool cache_free(struct t_cache *cache);
30
31bool cache_get_read_lock(struct t_cache *cache);
32bool cache_get_write_lock(struct t_cache *cache);
33bool cache_release_lock(struct t_cache *cache);
34
35#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:21
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
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