summaryrefslogtreecommitdiff
path: root/ot_mutex.c
diff options
context:
space:
mode:
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}