mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 11:42:33 +00:00
* Fixed various valgrind warnings.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1189 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+2
-3
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
static const unsigned int max_size = 32;
|
||||
|
||||
thread_queue_hack() { std::memset(m_queue, 0, sizeof(thread_queue_hack)); }
|
||||
thread_queue_hack() { std::memset(this, 0, sizeof(thread_queue_hack)); }
|
||||
|
||||
void lock() { while (!__sync_bool_compare_and_swap(&m_lock, 0, 1)) usleep(0); }
|
||||
void unlock() { __sync_bool_compare_and_swap(&m_lock, 1, 0); }
|
||||
@@ -94,8 +94,7 @@ public:
|
||||
}
|
||||
|
||||
void clear_and_unlock() {
|
||||
std::memset(m_queue, 0, sizeof(value_type) * (max_size + 1));
|
||||
m_lock = 0;
|
||||
std::memset(this, 0, sizeof(thread_queue_hack));
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user