summaryrefslogtreecommitdiff
path: root/ot_mutex.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-23 21:48:58 +0200
committerDirk Engling <erdgeist@erdgeist.org>2026-10-23 21:48:58 +0200
commitde67a4a721c0fda9a9b5955f235baafba9ba393d (patch)
tree38627ee2df6927e715e7043809d281b16abdbddc /ot_mutex.c
parenta8def0e5eac98500267b52c7f0d9a7fbc2145a81 (diff)
Rework config file parser and tidy up mem inits
Diffstat (limited to 'ot_mutex.c')
-rw-r--r--ot_mutex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ot_mutex.c b/ot_mutex.c
index be3ddf9..300da3a 100644
--- a/ot_mutex.c
+++ b/ot_mutex.c
@@ -7,11 +7,11 @@
7#include <pthread.h> 7#include <pthread.h>
8#include <stdio.h> 8#include <stdio.h>
9#include <stdlib.h> 9#include <stdlib.h>
10#include <string.h>
10#include <sys/mman.h> 11#include <sys/mman.h>
11#include <sys/uio.h> 12#include <sys/uio.h>
12 13
13/* Libowfat */ 14/* Libowfat */
14#include "byte.h"
15#include "io.h" 15#include "io.h"
16#include "uint32.h" 16#include "uint32.h"
17 17
@@ -259,7 +259,7 @@ void mutex_init(void) {
259 pthread_cond_init(&tasklist_being_filled, NULL); 259 pthread_cond_init(&tasklist_being_filled, NULL);
260 for (i = 0; i < OT_BUCKET_COUNT; ++i) 260 for (i = 0; i < OT_BUCKET_COUNT; ++i)
261 pthread_mutex_init(bucket_mutex + i, NULL); 261 pthread_mutex_init(bucket_mutex + i, NULL);
262 byte_zero(all_torrents, sizeof(all_torrents)); 262 memset(all_torrents, 0, sizeof(all_torrents));
263} 263}
264 264
265void mutex_deinit(void) { 265void mutex_deinit(void) {
@@ -268,5 +268,5 @@ void mutex_deinit(void) {
268 pthread_mutex_destroy(bucket_mutex + i); 268 pthread_mutex_destroy(bucket_mutex + i);
269 pthread_mutex_destroy(&tasklist_mutex); 269 pthread_mutex_destroy(&tasklist_mutex);
270 pthread_cond_destroy(&tasklist_being_filled); 270 pthread_cond_destroy(&tasklist_being_filled);
271 byte_zero(all_torrents, sizeof(all_torrents)); 271 memset(all_torrents, 0, sizeof(all_torrents));
272} 272}