SysTryReturn(NID_BASE_RT, pThreadImpl != null, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] This is not OSP thread.");
ThreadType threadType = pThreadImpl->GetThreadType();
- SysTryReturn(NID_BASE_RT, threadType != THREAD_TYPE_WORKER, null, E_INVALID_OPERATION,
- "[E_INVALID_OPERATION] This is a worker thread.");
+ if (threadType == THREAD_TYPE_WORKER)
+ {
+ pThreadImpl = _ThreadImpl::GetMainThreadImpl();
+ SysTryReturn(NID_BASE_RT, pThreadImpl != null, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] This is not OSP thread.");
+ }
_EventManager* pEventManager = pThreadImpl->GetEventManager();
SysTryReturn(NID_BASE_RT, pEventManager != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Event manager is not initialized.");