< prev index next >

src/hotspot/os/windows/attachListener_windows.cpp

Print this page




   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 #include "precompiled.hpp"
  26 #include "runtime/interfaceSupport.hpp"
  27 #include "runtime/os.hpp"
  28 #include "services/attachListener.hpp"
  29 #include "services/dtraceAttacher.hpp"
  30 
  31 #include <windows.h>
  32 #include <signal.h>             // SIGBREAK
  33 #include <stdio.h>
  34 
  35 // The AttachListener thread services a queue of operations. It blocks in the dequeue
  36 // function until an operation is enqueued. A client enqueues an operation by creating
  37 // a thread in this process using the Win32 CreateRemoteThread function. That thread
  38 // executes a small stub generated by the client. The stub invokes the
  39 // JVM_EnqueueOperation function which checks the operation parameters and enqueues
  40 // the operation to the queue serviced by the attach listener. The thread created by
  41 // the client is a native thread and is restricted to a single page of stack. To keep
  42 // it simple operations are pre-allocated at initialization time. An enqueue thus
  43 // takes a preallocated operation, populates the operation parameters, adds it to
  44 // queue and wakes up the attach listener.
  45 //
  46 // When an operation has completed the attach listener is required to send the




   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 #include "precompiled.hpp"
  26 #include "runtime/interfaceSupport.inline.hpp"
  27 #include "runtime/os.hpp"
  28 #include "services/attachListener.hpp"
  29 #include "services/dtraceAttacher.hpp"
  30 
  31 #include <windows.h>
  32 #include <signal.h>             // SIGBREAK
  33 #include <stdio.h>
  34 
  35 // The AttachListener thread services a queue of operations. It blocks in the dequeue
  36 // function until an operation is enqueued. A client enqueues an operation by creating
  37 // a thread in this process using the Win32 CreateRemoteThread function. That thread
  38 // executes a small stub generated by the client. The stub invokes the
  39 // JVM_EnqueueOperation function which checks the operation parameters and enqueues
  40 // the operation to the queue serviced by the attach listener. The thread created by
  41 // the client is a native thread and is restricted to a single page of stack. To keep
  42 // it simple operations are pre-allocated at initialization time. An enqueue thus
  43 // takes a preallocated operation, populates the operation parameters, adds it to
  44 // queue and wakes up the attach listener.
  45 //
  46 // When an operation has completed the attach listener is required to send the


< prev index next >