summaryrefslogtreecommitdiff
path: root/ot_mutex.c
diff options
context:
space:
mode:
authorerdgeist <>2008-12-08 02:23:21 +0000
committererdgeist <>2008-12-08 02:23:21 +0000
commita9ab9b0c0dbd5de29d1aef9927cca92ac522d4cb (patch)
tree98356c754d090611d9b34dbf1f51b045b124d6f3 /ot_mutex.c
parentbca8bee62334de23fdb28ae5a8fa76b5d72089cb (diff)
Make all torrents in their buckets sorted again.
Diffstat (limited to 'ot_mutex.c')
-rw-r--r--ot_mutex.c4
1 files changed, 2 insertions, 2 deletions
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 ) {
80} 80}
81 81
82ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ) { 82ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ) {
83 int bucket = uint32_read( *hash ) % OT_BUCKET_COUNT; 83 int bucket = uint32_read_big( (char*)*hash ) >> OT_BUCKET_COUNT_SHIFT;
84 84
85 /* Can block */ 85 /* Can block */
86 mutex_bucket_lock( bucket ); 86 mutex_bucket_lock( bucket );
@@ -95,7 +95,7 @@ void mutex_bucket_unlock( int bucket ) {
95} 95}
96 96
97void mutex_bucket_unlock_by_hash( ot_hash *hash ) { 97void mutex_bucket_unlock_by_hash( ot_hash *hash ) {
98 mutex_bucket_unlock( uint32_read( *hash ) % OT_BUCKET_COUNT ); 98 mutex_bucket_unlock( uint32_read_big( (char*)*hash ) >> OT_BUCKET_COUNT_SHIFT );
99} 99}
100 100
101/* TaskQueue Magic */ 101/* TaskQueue Magic */