2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-03 09:42:16 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
nobody
0d3eb714b6 This commit was manufactured by cvs2svn to create tag
'Version_1_28_0'.

[SVN r13949]
2002-05-16 13:26:18 +00:00
William E. Kempf
b75a32b913 Fixed xtime bugs
[SVN r13865]
2002-05-14 21:11:36 +00:00
nobody
c6b8f21bde This commit was manufactured by cvs2svn to create branch 'RC_1_28_0'.
[SVN r13795]
2002-05-10 04:34:27 +00:00
6 changed files with 28 additions and 28 deletions

View File

@@ -62,9 +62,9 @@ lib boost_thread
#######################
# Stage the generated targets.
stage bin-stage
: <lib>boost_thread $(threadmon)
: <tag><runtime-link-static>"s"
<tag><debug>"d"
: debug release <runtime-link>static/dynamic
;
#stage bin-stage
# : <lib>boost_thread $(threadmon)
# : <tag><runtime-link-static>"s"
# <tag><debug>"d"
# : debug release <runtime-link>static/dynamic
#;

View File

@@ -244,7 +244,7 @@ void condition::do_wait()
bool condition::do_timed_wait(const xtime& xt)
{
unsigned milliseconds;
int milliseconds;
to_duration(xt, milliseconds);
unsigned int res = 0;
@@ -571,7 +571,7 @@ void condition::do_wait()
bool condition::do_timed_wait(const xtime& xt)
{
unsigned milliseconds;
int milliseconds;
to_duration(xt, milliseconds);
OSStatus lStatus = noErr;

View File

@@ -145,7 +145,7 @@ bool timed_mutex::do_trylock()
bool timed_mutex::do_timedlock(const xtime& xt)
{
unsigned milliseconds;
int milliseconds;
to_duration(xt, milliseconds);
unsigned int res = WaitForSingleObject(reinterpret_cast<HANDLE>(m_mutex), milliseconds);
@@ -500,7 +500,7 @@ bool timed_mutex::do_trylock()
bool timed_mutex::do_timedlock(const xtime& xt)
{
unsigned microseconds;
int microseconds;
to_microduration(xt, microseconds);
Duration lDuration = kDurationMicrosecond * microseconds;

View File

@@ -195,7 +195,7 @@ bool recursive_timed_mutex::do_trylock()
bool recursive_timed_mutex::do_timedlock(const xtime& xt)
{
unsigned milliseconds;
int milliseconds;
to_duration(xt, milliseconds);
unsigned int res = 0;
@@ -936,7 +936,7 @@ bool recursive_timed_mutex::do_trylock()
bool recursive_timed_mutex::do_timedlock(const xtime& xt)
{
unsigned microseconds;
int microseconds;
to_microduration(xt, microseconds);
Duration lDuration = kDurationMicrosecond * microseconds;

View File

@@ -192,13 +192,13 @@ void thread::join()
void thread::sleep(const xtime& xt)
{
#if defined(BOOST_HAS_WINTHREADS)
unsigned milliseconds;
int milliseconds;
to_duration(xt, milliseconds);
Sleep(milliseconds);
#elif defined(BOOST_HAS_PTHREADS)
# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
timespec ts;
to_timespec(xt, ts);
to_timespec_duration(xt, ts);
int res = 0;
res = pthread_delay_np(&ts);
assert(res == 0);
@@ -216,7 +216,7 @@ void thread::sleep(const xtime& xt)
cond.timed_wait(lock, xt);
# endif
#elif defined(BOOST_HAS_MPTASKS)
unsigned microseconds;
int microseconds;
to_microduration(xt, microseconds);
Duration lMicroseconds(kDurationMicrosecond * microseconds);
AbsoluteTime sWakeTime(DurationToAbsolute(lMicroseconds));

View File

@@ -10,14 +10,14 @@
// It is provided "as is" without express or implied warranty.
namespace {
const unsigned MILLISECONDS_PER_SECOND = 1000;
const unsigned NANOSECONDS_PER_SECOND = 1000000000;
const unsigned NANOSECONDS_PER_MILLISECOND = 1000000;
const int MILLISECONDS_PER_SECOND = 1000;
const int NANOSECONDS_PER_SECOND = 1000000000;
const int NANOSECONDS_PER_MILLISECOND = 1000000;
const unsigned MICROSECONDS_PER_SECOND = 1000000;
const unsigned NANOSECONDS_PER_MICROSECOND = 1000;
const int MICROSECONDS_PER_SECOND = 1000000;
const int NANOSECONDS_PER_MICROSECOND = 1000;
inline void to_time(unsigned milliseconds, boost::xtime& xt)
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
res = boost::xtime_get(&xt, boost::TIME_UTC);
@@ -45,7 +45,7 @@ namespace {
}
}
inline void to_time(unsigned milliseconds, timespec& ts)
inline void to_time(int milliseconds, timespec& ts)
{
boost::xtime xt;
to_time(milliseconds, xt);
@@ -83,7 +83,7 @@ namespace {
}
#endif
inline void to_duration(const boost::xtime& xt, unsigned& milliseconds)
inline void to_duration(const boost::xtime& xt, int& milliseconds)
{
boost::xtime cur;
int res = 0;
@@ -94,13 +94,13 @@ namespace {
milliseconds = 0;
else
{
milliseconds = static_cast<unsigned>(((xt.sec - cur.sec) * MILLISECONDS_PER_SECOND) +
milliseconds = ((xt.sec - cur.sec) * MILLISECONDS_PER_SECOND) +
(((xt.nsec - cur.nsec) + (NANOSECONDS_PER_MILLISECOND/2)) /
NANOSECONDS_PER_MILLISECOND));
NANOSECONDS_PER_MILLISECOND);
}
}
inline void to_microduration(const boost::xtime& xt, unsigned& microseconds)
inline void to_microduration(const boost::xtime& xt, int& microseconds)
{
boost::xtime cur;
int res = 0;
@@ -111,9 +111,9 @@ namespace {
microseconds = 0;
else
{
microseconds = static_cast<unsigned long>(((xt.sec - cur.sec) * MICROSECONDS_PER_SECOND) +
microseconds = ((xt.sec - cur.sec) * MICROSECONDS_PER_SECOND) +
(((xt.nsec - cur.nsec) + (NANOSECONDS_PER_MICROSECOND/2)) /
NANOSECONDS_PER_MICROSECOND));
NANOSECONDS_PER_MICROSECOND);
}
}
}