2 * Copyright 2012-2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __MSG_THREAD_H__
18 #define __MSG_THREAD_H__
21 /*==================================================================================================
23 ==================================================================================================*/
27 /*==================================================================================================
29 ==================================================================================================*/
33 MsgThread(): thd(0) {};
37 MSG_DEBUG("MsgThread::Start() called");
39 if (pthread_create(&thd, NULL, &MsgThread::thdMain, this) < 0)
41 MSG_DEBUG("pthread_create() error");
50 MSG_DEBUG("MsgThread::stop() called");
55 MSG_DEBUG("MsgThread::Wait() called");
57 pthread_join(thd, &pData);
61 static void* thdMain(void* pInst)
63 MSG_DEBUG("MsgThread::thdMain() called");
64 MsgThread* pt = static_cast<MsgThread*>(pInst);
69 virtual void run() = 0;
75 #endif //__MSG_THREAD_H__