version 1.11, 2009/02/27 08:39:08
|
version 1.11.6.2, 2013/07/20 18:33:04
|
|
|
#include <Pegasus/Common/Signal.h> | #include <Pegasus/Common/Signal.h> |
#include <Pegasus/Common/AutoPtr.h> | #include <Pegasus/Common/AutoPtr.h> |
#include <Pegasus/Common/Exception.h> | #include <Pegasus/Common/Exception.h> |
|
#include <Pegasus/Common/Pegasus_inl.h> |
#include <Service/PidFile.h> | #include <Service/PidFile.h> |
#include <Service/ServerRunStatus.h> | #include <Service/ServerRunStatus.h> |
| |
|
|
| |
ServerRunStatus::~ServerRunStatus() | ServerRunStatus::~ServerRunStatus() |
{ | { |
if (_event != NULL) |
setServerNotRunning(); |
{ |
|
CloseHandle(_event); |
|
} |
|
} | } |
| |
Boolean ServerRunStatus::isServerRunning() | Boolean ServerRunStatus::isServerRunning() |
|
|
return _wasAlreadyRunning; | return _wasAlreadyRunning; |
} | } |
| |
|
void ServerRunStatus::setServerNotRunning() |
|
{ |
|
if (_event != NULL) |
|
{ |
|
CloseHandle(_event); |
|
_event = NULL; |
|
} |
|
} |
|
|
void ServerRunStatus::setServerRunning() | void ServerRunStatus::setServerRunning() |
{ | { |
if (_event == NULL) | if (_event == NULL) |
|
|
| |
ServerRunStatus::~ServerRunStatus() | ServerRunStatus::~ServerRunStatus() |
{ | { |
|
setServerNotRunning(); |
|
} |
|
|
|
void ServerRunStatus::setServerNotRunning() |
|
{ |
if (_isRunningServerInstance) | if (_isRunningServerInstance) |
{ | { |
PidFile pidFile(_pidFilePath); | PidFile pidFile(_pidFilePath); |
pidFile.remove(); | pidFile.remove(); |
|
_isRunningServerInstance = false; |
} | } |
} | } |
| |
|
|
cnt += rtncnt; | cnt += rtncnt; |
if (rtncnt >= count) | if (rtncnt >= count) |
{ | { |
proctable=(struct procsinfo *) realloc( |
proctable = (struct procsinfo *)peg_inln_realloc( |
(void*)proctable, (size_t) (PROCSIZE*(cnt+count))); | (void*)proctable, (size_t) (PROCSIZE*(cnt+count))); |
if (!proctable) | if (!proctable) |
{ | { |