1*e8c8fa4bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*e8c8fa4bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*e8c8fa4bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*e8c8fa4bSAndrew Rist * distributed with this work for additional information 6*e8c8fa4bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*e8c8fa4bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*e8c8fa4bSAndrew Rist * "License"); you may not use this file except in compliance 9*e8c8fa4bSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*e8c8fa4bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*e8c8fa4bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*e8c8fa4bSAndrew Rist * software distributed under the License is distributed on an 15*e8c8fa4bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*e8c8fa4bSAndrew Rist * KIND, either express or implied. See the License for the 17*e8c8fa4bSAndrew Rist * specific language governing permissions and limitations 18*e8c8fa4bSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*e8c8fa4bSAndrew Rist *************************************************************/ 21*e8c8fa4bSAndrew Rist 22*e8c8fa4bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir 25cdf0e10cSrcweir #include <vos/diagnose.hxx> 26cdf0e10cSrcweir #include <vos/object.hxx> 27cdf0e10cSrcweir #include <vos/signal.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir using namespace vos; 30cdf0e10cSrcweir 31cdf0e10cSrcweir oslSignalAction vos::signalHandlerFunction_impl( 32cdf0e10cSrcweir void * pthis, oslSignalInfo * pInfo) 33cdf0e10cSrcweir { 34cdf0e10cSrcweir vos::OSignalHandler* pThis= (vos::OSignalHandler*)pthis; 35cdf0e10cSrcweir 36cdf0e10cSrcweir return ((oslSignalAction)pThis->signal(pInfo)); 37cdf0e10cSrcweir } 38cdf0e10cSrcweir 39cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////// 40cdf0e10cSrcweir // Thread class 41cdf0e10cSrcweir 42cdf0e10cSrcweir VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OSignalHandler, vos), 43cdf0e10cSrcweir VOS_NAMESPACE(OSignalHandler, vos), 44cdf0e10cSrcweir VOS_NAMESPACE(OObject, vos), 0); 45cdf0e10cSrcweir 46cdf0e10cSrcweir OSignalHandler::OSignalHandler() 47cdf0e10cSrcweir { 48cdf0e10cSrcweir m_hHandler = osl_addSignalHandler(signalHandlerFunction_impl, this); 49cdf0e10cSrcweir } 50cdf0e10cSrcweir 51cdf0e10cSrcweir OSignalHandler::~OSignalHandler() 52cdf0e10cSrcweir { 53cdf0e10cSrcweir osl_removeSignalHandler(m_hHandler); 54cdf0e10cSrcweir } 55cdf0e10cSrcweir 56cdf0e10cSrcweir OSignalHandler::TSignalAction OSignalHandler::raise(sal_Int32 Signal, void *pData) 57cdf0e10cSrcweir { 58cdf0e10cSrcweir return (TSignalAction)osl_raiseSignal(Signal, pData); 59cdf0e10cSrcweir } 60cdf0e10cSrcweir 61