forked from premiere/premiere-libtorrent
remove sleep() from the libtorrent API
This commit is contained in:
parent
a76b2a40b0
commit
881fa4dce6
|
@ -61,12 +61,6 @@ namespace libtorrent
|
||||||
typedef boost::asio::detail::mutex mutex;
|
typedef boost::asio::detail::mutex mutex;
|
||||||
typedef boost::asio::detail::event event;
|
typedef boost::asio::detail::event event;
|
||||||
|
|
||||||
// pauses the calling thread at least for the specified
|
|
||||||
// number of milliseconds
|
|
||||||
// TODO: 3 remove this function. at the very least it should not be part
|
|
||||||
// of the API
|
|
||||||
TORRENT_EXPORT void sleep(int milliseconds);
|
|
||||||
|
|
||||||
struct TORRENT_EXTRA_EXPORT condition_variable
|
struct TORRENT_EXTRA_EXPORT condition_variable
|
||||||
{
|
{
|
||||||
condition_variable();
|
condition_variable();
|
||||||
|
|
|
@ -46,16 +46,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
void sleep(int milliseconds)
|
|
||||||
{
|
|
||||||
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
|
|
||||||
Sleep(milliseconds);
|
|
||||||
#elif defined TORRENT_BEOS
|
|
||||||
snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
|
|
||||||
#else
|
|
||||||
usleep(milliseconds * 1000);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_PTHREADS
|
#ifdef BOOST_HAS_PTHREADS
|
||||||
|
|
||||||
|
|
|
@ -388,9 +388,15 @@ void print_ses_rate(float time
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_sleep(int millisec)
|
void test_sleep(int milliseconds)
|
||||||
{
|
{
|
||||||
libtorrent::sleep(millisec);
|
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
|
||||||
|
Sleep(milliseconds);
|
||||||
|
#elif defined TORRENT_BEOS
|
||||||
|
snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
|
||||||
|
#else
|
||||||
|
usleep(milliseconds * 1000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in New Issue