javaruntimes/starterutils/src.linux/osthreadsupervisor.h
branchRCL_3
changeset 18 9ac0a0a7da70
parent 17 0fd27995241b
child 19 71c436fe3ce0
equal deleted inserted replaced
17:0fd27995241b 18:9ac0a0a7da70
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Utility class for mointoring thread death.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef OSTHREADSUPERVISOR_H
       
    20 #define OSTHREADSUPERVISOR_H
       
    21 
       
    22 
       
    23 namespace java // codescanner::namespace
       
    24 {
       
    25 
       
    26 namespace runtime // codescanner::namespace
       
    27 {
       
    28 
       
    29 /**
       
    30  * This class is responsible for detecting abnormal thread death beloning to
       
    31  * own process. If the abnormal death happens this will terminate the whole
       
    32  * process. This is for Linux and the actual monitoring implementation is
       
    33  * missing.
       
    34  */
       
    35 class OsThreadSupervisor
       
    36 {
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Constructor of the OsThreadSupervisor.
       
    41      * @param tryThreadDumping Whether to try to do thread dump in panic case.
       
    42      *                         Might cause another panic.
       
    43      * @throws std::exception on error cases.
       
    44      */
       
    45     OsThreadSupervisor(bool tryThreadDumping);
       
    46 
       
    47     /**
       
    48      * Destructor of the RuntimeStarterUtils. Will stop the thread monitoring.
       
    49      * The class is not meant to be inherited, so destructor can be non
       
    50      * virtual.
       
    51      */
       
    52     ~OsThreadSupervisor();
       
    53 
       
    54 private: // Methods.
       
    55 
       
    56     /**
       
    57      * No default constructor.
       
    58      */
       
    59     OsThreadSupervisor();
       
    60 
       
    61     /*
       
    62      * No copy constructor allowed.
       
    63      */
       
    64     OsThreadSupervisor(const OsThreadSupervisor&);
       
    65 
       
    66     /*
       
    67      * No Assignment operator allowed.
       
    68      */
       
    69     OsThreadSupervisor& operator= (const OsThreadSupervisor&);
       
    70 };
       
    71 
       
    72 } // end namespace runtime
       
    73 } // end namespace java
       
    74 
       
    75 
       
    76 #endif // OSTHREADSUPERVISOR_H