diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 18:48:00 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 18:48:00 +0100 |
| commit | 5b25f89d00433f1c11576d1ea19304797dc60d1b (patch) | |
| tree | 3810c8585354f4795bd2f441b64f70e581855214 /ot_mutex.h | |
| parent | 0bd368691eb0d9051725d76b2a3721bb902c919b (diff) | |
Refactor ot_workqueue out of ot_mutex, no behaviour change
Diffstat (limited to 'ot_mutex.h')
| -rw-r--r-- | ot_mutex.h | 57 |
1 files changed, 0 insertions, 57 deletions
| @@ -10,7 +10,6 @@ | |||
| 10 | #include "trackerlogic.h" | 10 | #include "trackerlogic.h" |
| 11 | 11 | ||
| 12 | void mutex_init(void); | 12 | void mutex_init(void); |
| 13 | void mutex_workqueue_wakeall(void); | ||
| 14 | void mutex_deinit(void); | 13 | void mutex_deinit(void); |
| 15 | 14 | ||
| 16 | ot_vector *mutex_bucket_lock(int bucket); | 15 | ot_vector *mutex_bucket_lock(int bucket); |
| @@ -21,60 +20,4 @@ void mutex_bucket_unlock_by_hash(ot_hash const hash, int delta_torrentcoun | |||
| 21 | 20 | ||
| 22 | size_t mutex_get_torrent_count(void); | 21 | size_t mutex_get_torrent_count(void); |
| 23 | 22 | ||
| 24 | typedef enum { | ||
| 25 | TASK_STATS_CONNS = 0x0001, | ||
| 26 | TASK_STATS_TCP = 0x0002, | ||
| 27 | TASK_STATS_UDP = 0x0003, | ||
| 28 | TASK_STATS_SCRAPE = 0x0004, | ||
| 29 | TASK_STATS_FULLSCRAPE = 0x0005, | ||
| 30 | TASK_STATS_TPB = 0x0006, | ||
| 31 | TASK_STATS_HTTPERRORS = 0x0007, | ||
| 32 | TASK_STATS_VERSION = 0x0008, | ||
| 33 | TASK_STATS_RENEW = 0x000a, | ||
| 34 | TASK_STATS_SYNCS = 0x000b, | ||
| 35 | TASK_STATS_COMPLETED = 0x000c, | ||
| 36 | TASK_STATS_NUMWANTS = 0x000d, | ||
| 37 | |||
| 38 | TASK_STATS = 0x0100, /* Mask */ | ||
| 39 | TASK_STATS_TORRENTS = 0x0101, | ||
| 40 | TASK_STATS_PEERS = 0x0102, | ||
| 41 | TASK_STATS_SLASH24S = 0x0103, | ||
| 42 | TASK_STATS_TOP10 = 0x0104, | ||
| 43 | TASK_STATS_TOP100 = 0x0105, | ||
| 44 | TASK_STATS_EVERYTHING = 0x0106, | ||
| 45 | TASK_STATS_FULLLOG = 0x0107, | ||
| 46 | TASK_STATS_WOODPECKERS = 0x0108, | ||
| 47 | |||
| 48 | TASK_FULLSCRAPE = 0x0200, /* Default mode */ | ||
| 49 | TASK_FULLSCRAPE_TPB_BINARY = 0x0201, | ||
| 50 | TASK_FULLSCRAPE_TPB_ASCII = 0x0202, | ||
| 51 | TASK_FULLSCRAPE_TPB_ASCII_PLUS = 0x0203, | ||
| 52 | TASK_FULLSCRAPE_TPB_URLENCODED = 0x0204, | ||
| 53 | TASK_FULLSCRAPE_TRACKERSTATE = 0x0205, | ||
| 54 | |||
| 55 | TASK_DMEM = 0x0300, | ||
| 56 | |||
| 57 | TASK_DONE = 0x0f00, | ||
| 58 | TASK_DONE_PARTIAL = 0x0f01, | ||
| 59 | |||
| 60 | TASK_FLAG_GZIP = 0x1000, | ||
| 61 | TASK_FLAG_BZIP2 = 0x2000, | ||
| 62 | TASK_FLAG_ZSTD = 0x4000, | ||
| 63 | TASK_FLAG_CHUNKED = 0x8000, | ||
| 64 | |||
| 65 | TASK_TASK_MASK = 0x0fff, | ||
| 66 | TASK_CLASS_MASK = 0x0f00, | ||
| 67 | TASK_FLAGS_MASK = 0xf000 | ||
| 68 | } ot_tasktype; | ||
| 69 | |||
| 70 | typedef unsigned long ot_taskid; | ||
| 71 | |||
| 72 | int mutex_workqueue_pushtask(int64_t sock, ot_tasktype tasktype); | ||
| 73 | void mutex_workqueue_canceltask(int64_t sock); | ||
| 74 | void mutex_workqueue_pushsuccess(ot_taskid taskid); | ||
| 75 | ot_taskid mutex_workqueue_poptask(ot_tasktype *tasktype); | ||
| 76 | int mutex_workqueue_pushresult(ot_taskid taskid, size_t iovec_entries, struct iovec *iovector); | ||
| 77 | int mutex_workqueue_pushchunked(ot_taskid taskid, struct iovec *iovec); | ||
| 78 | int64_t mutex_workqueue_popresult(size_t *iovec_entries, struct iovec **iovector, int *is_partial); | ||
| 79 | |||
| 80 | #endif | 23 | #endif |
