merged changes from RC_1_0
This commit is contained in:
@@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/atomic.hpp>
|
||||
#include <list>
|
||||
#include "libtorrent/thread.hpp"
|
||||
#include "libtorrent/atomic.hpp"
|
||||
#include "test.hpp"
|
||||
|
||||
using namespace libtorrent;
|
||||
@@ -47,7 +47,7 @@ void fun(condition_variable* s, libtorrent::mutex* m, int* waiting, int i)
|
||||
fprintf(stderr, "thread %d done\n", i);
|
||||
}
|
||||
|
||||
void increment(condition_variable* s, libtorrent::mutex* m, int* waiting, atomic_count* c)
|
||||
void increment(condition_variable* s, libtorrent::mutex* m, int* waiting, boost::atomic<int>* c)
|
||||
{
|
||||
libtorrent::mutex::scoped_lock l(*m);
|
||||
*waiting += 1;
|
||||
@@ -57,7 +57,7 @@ void increment(condition_variable* s, libtorrent::mutex* m, int* waiting, atomic
|
||||
++*c;
|
||||
}
|
||||
|
||||
void decrement(condition_variable* s, libtorrent::mutex* m, int* waiting, atomic_count* c)
|
||||
void decrement(condition_variable* s, libtorrent::mutex* m, int* waiting, boost::atomic<int>* c)
|
||||
{
|
||||
libtorrent::mutex::scoped_lock l(*m);
|
||||
*waiting += 1;
|
||||
@@ -98,7 +98,7 @@ int test_main()
|
||||
threads.clear();
|
||||
|
||||
waiting = 0;
|
||||
atomic_count c(0);
|
||||
boost::atomic<int> c(0);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
threads.push_back(new thread(boost::bind(&increment, &cond, &m, &waiting, &c)));
|
||||
|
Reference in New Issue
Block a user