2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FBaseRtEventDrivenThread.cpp
19 * @brief This is the implementation file for the EventDrivenThread class.
24 #include <FBaseRtEventDrivenThread.h>
25 #include <FBaseSysLog.h>
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Collection;
31 namespace Tizen { namespace Base { namespace Runtime
34 EventDrivenThread::EventDrivenThread(void)
35 : __pEventDrivenThreadImpl(null)
40 EventDrivenThread::~EventDrivenThread(void)
46 EventDrivenThread::Construct(long stackSize, ThreadPriority priority)
48 SysTryReturnResult(NID_BASE_RT, stackSize > 0, E_INVALID_ARG, "Stack size must be greater than zero.");
50 return EventDrivenThread::Construct(L"thread", stackSize, priority);
54 EventDrivenThread::Construct(const String& name, long stackSize, ThreadPriority priority)
56 SysTryReturnResult(NID_BASE_RT, !name.IsEmpty(), E_INVALID_ARG, "Thread name is empty string.");
57 SysTryReturnResult(NID_BASE_RT, stackSize > 0, E_INVALID_ARG, "Stack size must be greater than zero.");
59 return Thread::Construct(name, THREAD_TYPE_EVENT_DRIVEN, stackSize, priority);
63 EventDrivenThread::Quit(void)
65 return Thread::Stop();
69 EventDrivenThread::SendUserEvent(RequestId requestId, const IList* pArgs)
71 return Thread::SendUserEvent(requestId, pArgs);
75 EventDrivenThread::Run(void)
81 EventDrivenThread::OnStart(void)
88 EventDrivenThread::OnStop(void)
94 EventDrivenThread::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
99 } } } // Tizen::Base::Runtime