version 1.13, 2006/07/11 18:39:33
|
version 1.14, 2006/08/09 21:12:56
|
|
|
#include "DynamicConsumerFacade.h" | #include "DynamicConsumerFacade.h" |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/IPC.h> |
#include <Pegasus/Common/Time.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/XmlWriter.h> | #include <Pegasus/Common/XmlWriter.h> |
|
|
if (!_initialized) | if (!_initialized) |
{ | { |
// yield before a potentially lengthy operation. | // yield before a potentially lengthy operation. |
pegasus_yield(); |
Threads::yield(); |
| |
try | try |
{ | { |
|
|
if (_initialized) | if (_initialized) |
{ | { |
// yield before a potentially lengthy operation. | // yield before a potentially lengthy operation. |
pegasus_yield(); |
Threads::yield(); |
| |
//terminate consumer | //terminate consumer |
try | try |
|
|
memcpy(tv, &_idleTime, sizeof(struct timeval)); | memcpy(tv, &_idleTime, sizeof(struct timeval)); |
} catch (...) | } catch (...) |
{ | { |
gettimeofday(tv, NULL); |
Time::gettimeofday(tv); |
} | } |
} | } |
| |
|
|
try | try |
{ | { |
AutoMutex lock(_idleTimeMutex); | AutoMutex lock(_idleTimeMutex); |
gettimeofday(&_idleTime, NULL); |
Time::gettimeofday(&_idleTime); |
| |
} catch (...) | } catch (...) |
{ | { |
|
|
} | } |
| |
struct timeval now; | struct timeval now; |
gettimeofday(&now, NULL); |
Time::gettimeofday(&now); |
| |
struct timeval timeout = {0,0}; | struct timeval timeout = {0,0}; |
getIdleTimer(&timeout); | getIdleTimer(&timeout); |