summaryrefslogtreecommitdiff
path: root/src/cache/threaded_waits.h
blob: fd9a8e64465ed7a99f923b73b2b652cc7ee4ffc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <al/types.h>
#include <nnwt/thread.h>

#include "backing.h"
#include "wait.h"

struct cch_threaded_waits {
    bool disabled;
    struct nn_mutex lock;
    array(struct cch_wait *) active;
};

void cch_threaded_waits_init(struct cch_threaded_waits *thw);
bool cch_threaded_wait_for_range(struct cch_threaded_waits *thw, struct cch_backing *backing,
    struct cch_wait *wait);
void cch_threaded_waits_signal_anys(struct cch_threaded_waits *thw);
void cch_threaded_waits_evaluate(struct cch_threaded_waits *thw, struct cch_backing *backing);
void cch_threaded_wait_disable(struct cch_wait *wait);
void cch_threaded_wait_enable(struct cch_wait *wait);
void cch_threaded_waits_disable_all(struct cch_threaded_waits *thw);
void cch_threaded_waits_close(struct cch_threaded_waits *thw);