From a9ab9b0c0dbd5de29d1aef9927cca92ac522d4cb Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 8 Dec 2008 02:23:21 +0000 Subject: Make all torrents in their buckets sorted again. --- ot_mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ot_mutex.c') diff --git a/ot_mutex.c b/ot_mutex.c index 2300f5c..a28144b 100644 --- a/ot_mutex.c +++ b/ot_mutex.c @@ -80,7 +80,7 @@ ot_vector *mutex_bucket_lock( int bucket ) { } ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ) { - int bucket = uint32_read( *hash ) % OT_BUCKET_COUNT; + int bucket = uint32_read_big( (char*)*hash ) >> OT_BUCKET_COUNT_SHIFT; /* Can block */ mutex_bucket_lock( bucket ); @@ -95,7 +95,7 @@ void mutex_bucket_unlock( int bucket ) { } void mutex_bucket_unlock_by_hash( ot_hash *hash ) { - mutex_bucket_unlock( uint32_read( *hash ) % OT_BUCKET_COUNT ); + mutex_bucket_unlock( uint32_read_big( (char*)*hash ) >> OT_BUCKET_COUNT_SHIFT ); } /* TaskQueue Magic */ -- cgit v1.2.3