src/os/solaris/vm/osThread_solaris.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff src/os/solaris/vm

src/os/solaris/vm/osThread_solaris.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2014, 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  *


  49   void    set_caller_sigmask(sigset_t sigmask)  { _caller_sigmask = sigmask; }
  50 
  51 #ifndef PRODUCT
  52   // Used for debugging, return a unique integer for each thread.
  53   int thread_identifier() const   { return _thread_id; }
  54 #endif
  55 #ifdef ASSERT
  56   // On solaris reposition can fail in two ways:
  57   // 1: a mismatched pc, because signal is delivered too late, target thread
  58   //    is resumed.
  59   // 2: on a timeout where signal is lost, target thread is resumed.
  60   bool valid_reposition_failure() {
  61     // only 1 and 2 can happen and we can handle both of them
  62     return true;
  63   }
  64 #endif
  65   void set_lwp_id(uint id)           { _lwp_id = id; }
  66   void set_native_priority(int prio) { _native_priority = prio; }
  67 
  68  // ***************************************************************
  69  // interrupt support.  interrupts (using signals) are used to get
  70  // the thread context (get_thread_pc), to set the thread context
  71  // (set_thread_pc), and to implement java.lang.Thread.interrupt.
  72  // ***************************************************************
  73 
  74  public:
  75   os::SuspendResume sr;
  76 
  77  private:
  78   ucontext_t* _ucontext;
  79 
  80  public:
  81   ucontext_t* ucontext() const { return _ucontext; }
  82   void set_ucontext(ucontext_t* ptr) { _ucontext = ptr; }
  83   static void SR_handler(Thread* thread, ucontext_t* uc);
  84 
  85   // ***************************************************************
  86   // Platform dependent initialization and cleanup
  87   // ***************************************************************
  88 
  89 private:
  90 
  91   void pd_initialize();
   1 /*
   2  * Copyright (c) 1997, 2017, 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  *


  49   void    set_caller_sigmask(sigset_t sigmask)  { _caller_sigmask = sigmask; }
  50 
  51 #ifndef PRODUCT
  52   // Used for debugging, return a unique integer for each thread.
  53   int thread_identifier() const   { return _thread_id; }
  54 #endif
  55 #ifdef ASSERT
  56   // On solaris reposition can fail in two ways:
  57   // 1: a mismatched pc, because signal is delivered too late, target thread
  58   //    is resumed.
  59   // 2: on a timeout where signal is lost, target thread is resumed.
  60   bool valid_reposition_failure() {
  61     // only 1 and 2 can happen and we can handle both of them
  62     return true;
  63   }
  64 #endif
  65   void set_lwp_id(uint id)           { _lwp_id = id; }
  66   void set_native_priority(int prio) { _native_priority = prio; }
  67 
  68  // ***************************************************************
  69  // interrupt support.  interrupts (using signals) are used to
  70  // implement java.lang.Thread.interrupt.

  71  // ***************************************************************
  72 
  73  public:
  74   os::SuspendResume sr;
  75 
  76  private:
  77   ucontext_t* _ucontext;
  78 
  79  public:
  80   ucontext_t* ucontext() const { return _ucontext; }
  81   void set_ucontext(ucontext_t* ptr) { _ucontext = ptr; }
  82   static void SR_handler(Thread* thread, ucontext_t* uc);
  83 
  84   // ***************************************************************
  85   // Platform dependent initialization and cleanup
  86   // ***************************************************************
  87 
  88 private:
  89 
  90   void pd_initialize();
src/os/solaris/vm/osThread_solaris.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File