src/os/solaris/vm/os_solaris.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 



  25 // Solaris_OS defines the interface to Solaris operating systems
  26 
  27 class Solaris {
  28   friend class os;
  29 
  30  private:
  31 
  32   // Support for "new" libthread APIs for getting & setting thread context (2.8)
  33   #define TRS_VALID       0
  34   #define TRS_NONVOLATILE 1
  35   #define TRS_LWPID       2
  36   #define TRS_INVALID     3
  37 
  38   // _T2_libthread is true if we believe we are running with the newer
  39   // SunSoft lib/lwp/libthread: default Solaris 9, available Solaris 8
  40   // which is a lightweight libthread that also supports all T1
  41   static bool _T2_libthread;
  42   // These refer to new libthread interface functions
  43   // They get intialized if we dynamically detect new libthread
  44   static int_fnP_thread_t_iP_uP_stack_tP_gregset_t _thr_getstate;


 377     void unpark () ;
 378 } ;
 379 
 380 class PlatformParker : public CHeapObj {
 381   protected:
 382     mutex_t _mutex [1] ;
 383     cond_t  _cond  [1] ;
 384 
 385   public:       // TODO-FIXME: make dtor private
 386     ~PlatformParker() { guarantee (0, "invariant") ; }
 387 
 388   public:
 389     PlatformParker() {
 390       int status;
 391       status = os::Solaris::cond_init(_cond);
 392       assert_status(status == 0, status, "cond_init");
 393       status = os::Solaris::mutex_init(_mutex);
 394       assert_status(status == 0, status, "mutex_init");
 395     }
 396 } ;


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef OS_SOLARIS_VM_OS_SOLARIS_HPP
  26 #define OS_SOLARIS_VM_OS_SOLARIS_HPP
  27 
  28 // Solaris_OS defines the interface to Solaris operating systems
  29 
  30 class Solaris {
  31   friend class os;
  32 
  33  private:
  34 
  35   // Support for "new" libthread APIs for getting & setting thread context (2.8)
  36   #define TRS_VALID       0
  37   #define TRS_NONVOLATILE 1
  38   #define TRS_LWPID       2
  39   #define TRS_INVALID     3
  40 
  41   // _T2_libthread is true if we believe we are running with the newer
  42   // SunSoft lib/lwp/libthread: default Solaris 9, available Solaris 8
  43   // which is a lightweight libthread that also supports all T1
  44   static bool _T2_libthread;
  45   // These refer to new libthread interface functions
  46   // They get intialized if we dynamically detect new libthread
  47   static int_fnP_thread_t_iP_uP_stack_tP_gregset_t _thr_getstate;


 380     void unpark () ;
 381 } ;
 382 
 383 class PlatformParker : public CHeapObj {
 384   protected:
 385     mutex_t _mutex [1] ;
 386     cond_t  _cond  [1] ;
 387 
 388   public:       // TODO-FIXME: make dtor private
 389     ~PlatformParker() { guarantee (0, "invariant") ; }
 390 
 391   public:
 392     PlatformParker() {
 393       int status;
 394       status = os::Solaris::cond_init(_cond);
 395       assert_status(status == 0, status, "cond_init");
 396       status = os::Solaris::mutex_init(_mutex);
 397       assert_status(status == 0, status, "mutex_init");
 398     }
 399 } ;
 400 
 401 #endif // OS_SOLARIS_VM_OS_SOLARIS_HPP