2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-30 08:22:13 +00:00

Added tutorial sources. Changed tabs to spaces.

[SVN r15179]
This commit is contained in:
William E. Kempf
2002-09-06 15:34:48 +00:00
parent 05d1abf030
commit cfce0892e0
27 changed files with 663 additions and 546 deletions

View File

@@ -145,25 +145,25 @@ bool timed_mutex::do_trylock()
bool timed_mutex::do_timedlock(const xtime& xt)
{
unsigned int res = 0;
for (;;)
{
int milliseconds;
to_duration(xt, milliseconds);
unsigned int res = 0;
for (;;)
{
int milliseconds;
to_duration(xt, milliseconds);
res = WaitForSingleObject(reinterpret_cast<HANDLE>(m_mutex), milliseconds);
assert(res != WAIT_FAILED && res != WAIT_ABANDONED);
res = WaitForSingleObject(reinterpret_cast<HANDLE>(m_mutex), milliseconds);
assert(res != WAIT_FAILED && res != WAIT_ABANDONED);
if (res == WAIT_TIMEOUT)
{
xtime cur;
xtime_get(&cur, TIME_UTC);
if (xtime_cmp(xt, cur) > 0)
continue;
}
if (res == WAIT_TIMEOUT)
{
xtime cur;
xtime_get(&cur, TIME_UTC);
if (xtime_cmp(xt, cur) > 0)
continue;
}
return res == WAIT_OBJECT_0;
}
return res == WAIT_OBJECT_0;
}
}
void timed_mutex::do_unlock()