diff options
author | erdgeist <> | 2008-12-08 02:23:21 +0000 |
---|---|---|
committer | erdgeist <> | 2008-12-08 02:23:21 +0000 |
commit | a9ab9b0c0dbd5de29d1aef9927cca92ac522d4cb (patch) | |
tree | 98356c754d090611d9b34dbf1f51b045b124d6f3 /ot_mutex.c | |
parent | bca8bee62334de23fdb28ae5a8fa76b5d72089cb (diff) |
Make all torrents in their buckets sorted again.
Diffstat (limited to 'ot_mutex.c')
-rw-r--r-- | ot_mutex.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -80,7 +80,7 @@ ot_vector *mutex_bucket_lock( int bucket ) { | |||
80 | } | 80 | } |
81 | 81 | ||
82 | ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ) { | 82 | ot_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 | ||
97 | void mutex_bucket_unlock_by_hash( ot_hash *hash ) { | 97 | void 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 */ |