Show
Ignore:
Timestamp:
11/22/08 00:36:22 (17 years ago)
Author:
yumileroy
Message:

Merged commit 269 (5f0e38da128a).

Original author: gvcoman
Date: 2008-11-21 14:34:05-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/trinitycore/Master.cpp

    r272 r279  
    7878        m_lastchange = 0; 
    7979        w_lastchange = 0; 
    80         while(!World::m_stopEvent) 
     80        while(!World::IsStopped()) 
    8181        { 
    8282            ZThread::Thread::sleep(1000); 
     
    173173    // if use ra spend time waiting for io, if not use ra ,just sleep 
    174174    if (usera) 
    175       while (!World::m_stopEvent) 
     175      while (!World::IsStopped()) 
    176176        { 
    177177          h.Select (0, socketSelecttime); 
     
    179179        } 
    180180    else 
    181       while (!World::m_stopEvent) 
     181      while (!World::IsStopped()) 
    182182        { 
    183183          ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000)); 
     
    324324    { 
    325325      sLog.outError ("Failed to start network"); 
    326       World::m_stopEvent = true; 
     326      World::StopNow(ERROR_EXIT_CODE); 
    327327      // go down and shutdown the server 
    328328    } 
     
    395395    UnloadScriptingModule(); 
    396396 
    397     return sWorld.GetShutdownMask() & SHUTDOWN_MASK_RESTART ? 2 : 0; 
     397    // Exit the process with specified return value 
     398    return World::GetExitCode(); 
    398399} 
    399400 
     
    478479 
    479480/// Handle termination signals 
    480 /** Put the World::m_stopEvent to 'true' if a termination signal is caught **/ 
    481481void Master::_OnSignal(int s) 
    482482{ 
     
    484484    { 
    485485        case SIGINT: 
     486            World::StopNow(RESTART_EXIT_CODE); 
     487            break; 
    486488        case SIGTERM: 
    487489        #ifdef _WIN32 
    488490        case SIGBREAK: 
    489491        #endif 
    490             World::m_stopEvent = true; 
     492            World::StopNow(SHUTDOWN_EXIT_CODE); 
    491493            break; 
    492494    }