2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NSFramework
19 /// \brief Application framework's core structures and data types.
23 ///////////////////////////////////////////////////////////////////////////////
25 #ifndef FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_CORE_H_
26 #define FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_CORE_H_
31 #include <other_service/strlcpy.h>
32 #include <native_service/frameworkunified_framework_types.h>
33 #include <native_service/ns_logger_if.h>
43 static const UI_32 THREAD_SESSION_ID = 0;
45 typedef HANDLE SessionHandle;
46 typedef int SessionId; // < service protocol command
47 typedef int ServiceProtocolCommand; // < service protocol command
48 typedef int Fd; // < FD associated with callback
49 typedef std::string Notification; // < notification name
50 typedef std::string ServiceName; // < service name
51 typedef std::string ThreadName;
52 typedef std::string DataKey;
53 typedef std::string InvokerName;
55 typedef std::string ConnectKey;
58 typedef std::map<Notification, CallbackFunctionPtr> NotificationTable;
61 typedef std::map<ServiceProtocolCommand, CallbackFunctionPtr> ServiceProtocolTable;
62 typedef std::map<SessionId, ServiceProtocolTable> SessionTable;
63 typedef std::map<ServiceName, SessionTable> Services;
64 typedef std::map<HANDLE, ServiceName> ServiceSendMsgHandle;
65 typedef std::map<Fd, CallbackFunctionPtr> FdTable;
68 typedef std::map<ServiceProtocolCommand, EventId> ServiceEventProtocolTable;
69 typedef std::map<SessionId, ServiceEventProtocolTable> EventSessionTable;
70 typedef std::map<ServiceName, EventSessionTable> EventServices;
71 typedef std::map<Notification, EventId> NotificationEventTable;
72 typedef std::map<SessionId, SessionHandle> SessionHandleTable;
73 typedef std::map<ServiceName, SessionHandleTable> ServiceSessionTable;
74 typedef std::map<InvokerName, HANDLE> InvokeResponseQTable;
75 typedef std::map<Socket, ConnectKey> AcceptMonitorTable;
76 typedef std::map<Socket, ConnectKey> ConnectMonitorTable;
78 typedef std::pair<NotificationTable::iterator, bool> NotificationTableRetStatus;
79 typedef std::map<DataKey, Data> AppData;
81 // private event data structure
82 typedef struct _EventData {
83 PVOID pData; /// <message data
84 UI_32 uiLength; /// <message length
87 // framework message queue info
88 typedef struct _MsgQInfo {
89 CHAR cSrcName[MAX_NAME_SIZE_APP]; /// <source message queue name
90 CHAR cMsgQName[MAX_NAME_SIZE_APP]; /// <name of the handle to the msgq
93 HANDLE hMsgQ; /// <handle to message queue
94 UI_32 sessionId; /// <Used only when it is a session handle
97 #define MSGQ_CHECK_CODE (0xACCE55ED)
99 static inline BOOL frameworkunifiedCheckValidMsgQ(HANDLE hService) {
100 static __thread int detect_once = 0;
101 if (NULL != hService) {
102 MsgQInfo *pMsgQ = reinterpret_cast<MsgQInfo *>(hService);
105 * If an application handle is specified in place of a session handle,
106 * the element is accessed illegally without type checking,
107 * and a DeathTest occurs because the thread_self check is violated.
109 if (pMsgQ->self != pthread_self() && detect_once == 0) {
110 FRAMEWORKUNIFIEDLOG(ZONE_NS_WAR, __func__, "Invalid thread context detect(hService/hSession):%#lx:%#lx", pMsgQ->self,
114 if (pMsgQ->checkCode == MSGQ_CHECK_CODE) {
121 /* data structure for public state events and data associated with it */
122 // map of state events and data associated with it
123 typedef std::map<UI_32, EventData *> PublicStateEventTable;
125 /* data structure for private state events and data associated with it */
126 // list of session id's of service and event data(private) associated with it
127 typedef std::map<UI_32, EventData *> SessionEventData;
129 // map of service name and list of its session id's and associated event data
130 typedef std::map<ServiceName, SessionEventData> ServiceSessionEventData;
132 // map of private events and the data published on the all sessions of all services subscribed to it
133 typedef std::map<UI_32, ServiceSessionEventData> PrivateStateEventTable;
136 // list of session id's for each service registering with event
137 typedef std::vector<UI_32> SessionIdList;
138 typedef std::vector<UI_32> EventIdList;
140 // map of service name and and list of its session id
141 typedef std::map<ServiceName, SessionIdList> ServiceSessionIdListTable;
142 // map of events and its subscribers
143 typedef std::map<UI_32, ServiceSessionIdListTable> EventTable;
145 // structure to hold the session handle and list of event ids for that session
146 typedef struct _SessionEventInfo {
147 HANDLE m_hSession; // Msg queue handle for the specific session
148 EventIdList m_vEvents; // List of event ids corresponding to the session
149 } SessionEventInfo, *PSessionEventInfo;
151 // map to hold the session id and structure of session event info
152 typedef std::map<SessionId, SessionEventInfo *> SessionToEventInfo;
154 // map of service name with session id and session handle
155 typedef std::map<ServiceName, SessionToEventInfo > ServiceSessionHandleTable;
158 // When a pop is issued this data will be copied to the internal CFrameworkunifiedFrameworkApp struct
159 // which will call the FrameworkunifiedDispatchProcess that will process the message as if
160 // it was received off the message queue!
161 class DeferedMsgInfo {
162 void copy_me(const DeferedMsgInfo &defer) {
163 if (this != &defer) {
164 uiProtocolCmd = defer.uiProtocolCmd;
165 strlcpy(cMsgSrcName, defer.cMsgSrcName, sizeof(cMsgSrcName));
166 std::memcpy(uiMsgRcvBuffer, defer.uiMsgRcvBuffer, MAX_MSGQ_BUFFER);
171 UI_32 uiProtocolCmd; /// <protocol req/ack received
172 CHAR cMsgSrcName[MAX_NAME_SIZE_APP]; /// <name of client/server(application) message queue
173 UI_8 uiMsgRcvBuffer[MAX_MSGQ_BUFFER]; /// <receive buffer for message queue
175 DeferedMsgInfo() : uiProtocolCmd(0) {
176 std::memset(uiMsgRcvBuffer, 0, MAX_MSGQ_BUFFER);
177 std::memset(cMsgSrcName, '\0', MAX_NAME_SIZE_APP);
180 DeferedMsgInfo(const DeferedMsgInfo &defer) {
181 copy_me(defer); // LCOV_EXCL_BR_LINE 11:except branch
184 DeferedMsgInfo(UI_32 cmd, PCSTR name, UI_8 buf[MAX_MSGQ_BUFFER]) {
185 DeferedMsgInfo defer;
187 defer.uiProtocolCmd = cmd;
188 strlcpy(defer.cMsgSrcName, name, sizeof(defer.cMsgSrcName));
189 std::memcpy(defer.uiMsgRcvBuffer, buf, MAX_MSGQ_BUFFER);
194 DeferedMsgInfo &operator = (const DeferedMsgInfo &defer) {
201 typedef struct _ServiceNotificationInfo {
202 CHAR sNotificationName[MAX_SYS_INFO_SIZE];
204 } ServiceNotificationInfo;
206 typedef std::vector<ServiceNotificationInfo> NotificationList;
207 typedef std::queue<DeferedMsgInfo> DeferedMessageQueue;
209 typedef struct _LostSessionInfo {
210 std::string sServiceName;
211 SessionId iSessionId;
214 typedef std::queue<LostSessionInfo> LostSessionQueue;
216 #ifdef DISPATCHER_PROFILER
217 class FrameworkunifiedMsgProfiler;
221 std::vector<UI_8> rawBuffer;
224 void set(PVOID src, UI_32 size) {
225 rawBuffer.resize(size);
226 std::memcpy(&rawBuffer[0], src, size);
230 return rawBuffer.empty() ? NULL : &rawBuffer[0];
234 std::vector<UI_8>().swap(rawBuffer);
238 return static_cast<UI_32>(rawBuffer.size());
243 // framework container
244 typedef struct _CFrameworkunifiedFrameworkApp {
245 CHAR cAppName[MAX_NAME_SIZE_APP]; /// <application(client/service) name
246 UI_32 checkCode; /// <check code
249 // message receive information
250 HANDLE hAppRcvMsgQ; /// <handle to apps receive message queue
251 HANDLE hAppSndMsgQ; /// <handle to apps send message queue
252 UI_32 uiMsgLength; /// <length of data in message queue
253 UI_32 uiProtocolCmd; /// <protocol req/ack received
255 CHAR cSystemInfo[MAX_SYS_INFO_SIZE];
256 CHAR cMsgSrcName[MAX_NAME_SIZE_APP]; /// <name of client/server(application) message queue
257 UI_8 uiMsgRcvBuffer[MAX_MSGQ_BUFFER]; /// <receive buffer for message queue
258 int efd; /// <FD for multiple wait generated by the epoll_create()
259 int defer_evfd; /// <FD for receiving Defer events to Dispatcher
261 Services services; /// <services <map>
262 ServiceSendMsgHandle servicesHandle; /// <serviceHandle <map>
263 NotificationTable notifications; /// <notification <map>
264 FdTable fds; /// <fdTable <map>
266 InvokeResponseQTable invokeResQTable;
268 AcceptMonitorTable acceptMonitorTable;
269 ConnectMonitorTable connectMonitorTable;
270 LostSessionQueue lostSessionQueue;
271 CallbackFunctionPtr lostSessionHandler;
273 EventServices eventservices;
274 NotificationEventTable notificationevents;
278 // Defer'ed Message Queue
279 DeferedMessageQueue deferedMsgQueue; /// <defer'ed message <queue>
282 HANDLE hNPSndMsgQ; /// <send msgq handle to NPService
284 // application & framework errors
285 EFrameworkunifiedStatus eLastFrameworkError; /// <Framework internal errors
286 EFrameworkunifiedStatus eLastAppError; /// <application(client/server/child thread) reported errors
288 /////////////////////////////////////////
290 HANDLE hParentSndMsgQ;
291 CHAR cParentAppName[MAX_NAME_SIZE_APP]; /// <application(client/service) name
292 /////////////////////////////////////////
294 HANDLE hConfigFileHandle;
296 class CFrameworkunifiedHSMFramework *m_pFrameworkunifiedStateMachine;
298 ServiceSessionTable sessiontable;
299 NotificationList servicenotificationlist;
300 CHAR sServiceAvailabilityNotification[MAX_SYS_INFO_SIZE];
303 ServiceSessionHandleTable servicesessionhandletable;
307 // framework state information
308 // TODO(framework_unified): consider this for future
313 // table holding list of all the events of service and its subscribers
314 EventTable eventtable;
316 // table holding list of all the public events of service and the event data corresponding to it
317 PublicStateEventTable publicstateeventtable;
319 // table holding list of all the private events of service and
320 // the event data corresponding to each of the subscribed session of its subscribers
321 PrivateStateEventTable privatestateeventtable;
323 ResponseData responsedata;
325 UI_64 total_occupy_time;
326 UI_64 total_run_count;
327 UI_32 max_occupy_time;
331 BOOL fDeferredSyncResponse;
333 #ifdef DISPATCHER_PROFILER
334 // Profiler object. This is required per dispatcher
335 FrameworkunifiedMsgProfiler *m_pFrameworkunifiedMsgProfiler;
337 } CFrameworkunifiedFrameworkApp;
339 // Structure containing the synchronization data
340 struct SFrameworkunifiedSyncDataPacket {
341 PVOID m_pNotificationData; // Data published with the notification
342 UI_32 m_uiDataSize; // Size of the data published with the notification
343 time_t m_tTimeStamp; // Time when the notification was recently published
347 PCData(pthread_barrier_t *bar, EFrameworkunifiedStatus *status, PCSTR parent, PCSTR child, CbFuncPtr init, CbFuncPtr shdn,
348 EFrameworkunifiedSchedPolicy policy, SI_32 priority, CbFuncPtr CreateHSM = NULL)
356 schedPriority(priority),
357 CbCreateStateMachine(CreateHSM) { // LCOV_EXCL_BR_LINE 11:except branch
360 pthread_barrier_t *barrier;
361 EFrameworkunifiedStatus *childStatus;
362 const ServiceName parentName;
363 const ServiceName childName;
366 EFrameworkunifiedSchedPolicy schedPolicy;
368 CbFuncPtr CbCreateStateMachine;
371 #define APP_CHECK_CODE (0xAC1D5EED)
373 static inline BOOL frameworkunifiedCheckValidAppHandle(HANDLE hApp) {
374 static __thread int detect_once = 0;
376 CFrameworkunifiedFrameworkApp *pApp = reinterpret_cast< CFrameworkunifiedFrameworkApp * >(hApp);
379 * eFrameworkunifiedStatusOK is returned even if a appHandle created in another thread is passed,
380 * and the specifications and operations differ.
382 * If an application handle is specified in place of a session handle,
383 * the element is accessed illegally without type checking,
384 * and a DeathTest occurs because the thread_self check is violated.
386 * If you specify an app handle for a child thread,
387 * the NULL's return value is not terminated abnormally at the intended point (frameworkunifiedCheckValidAppHandle).
389 if (pApp->self != pthread_self() && detect_once == 0) {
390 FRAMEWORKUNIFIEDLOG(ZONE_NS_WAR, __func__, "Invalid thread context detect(hApp):%#lx:%#lx", pApp->self, pthread_self());
393 if (pApp->checkCode == APP_CHECK_CODE) {
400 ////////////////////////////////////////////////////////////////////////////////////////////
401 /// NPSubscribeToNotification
402 /// API to send message to Notification Service to add to subscription list for
403 /// that notification
406 /// HANDLE - Handle to the Framework
407 /// \param [in] pNotification
408 /// PCSTR - Name of Notification
411 /// EFrameworkunifiedStatus - success or error
412 ////////////////////////////////////////////////////////////////////////////////////////////
413 EFrameworkunifiedStatus FrameworkunifiedNPSubscribeToNotification(HANDLE hApp, PCSTR pNotification);
416 ////////////////////////////////////////////////////////////////////////////////////////////
417 /// FrameworkunifiedNPSubscribeToNotifications
418 /// API to send message to Notification Service to add multiple subscriptions list for
419 /// that notification
422 /// HANDLE - Handle to the Framework
423 /// \param [in] pList
424 /// FrameworkunifiedNotificationCallbackHandler - Name of Notification
425 /// \param [in] uiListLength
426 /// UI_32 - number of notification that your subscribing too.
429 /// EFrameworkunifiedStatus - success or error
430 ////////////////////////////////////////////////////////////////////////////////////////////
431 EFrameworkunifiedStatus FrameworkunifiedNPSubscribeToNotifications(HANDLE hApp, const FrameworkunifiedNotificationCallbackHandler *pList, UI_32 uiListLength);
433 ////////////////////////////////////////////////////////////////////////////////////////////
434 /// NPUnsubscribeFromNotification
435 /// API to send message to Notification Service to remove from subscription list for
436 /// that notification
439 /// HANDLE - Handle to the Framework
440 /// \param [in] pNotification
441 /// PCSTR - Name of Notification
444 /// EFrameworkunifiedStatus - success or error
445 ////////////////////////////////////////////////////////////////////////////////////////////
446 EFrameworkunifiedStatus FrameworkunifiedNPUnsubscribeFromNotification(HANDLE hApp, PCSTR pNotification);
448 ////////////////////////////////////////////////////////////////////////////////////////////
449 /// FrameworkunifiedNPUnsubscribeFromNotifications
450 /// API to send message to Notification Service to remove multiple notification from subscription list for
451 /// that notification
454 /// HANDLE - Handle to the Framework
455 /// \param [in] pList
456 /// FrameworkunifiedNotificationCallbackHandler - notifications list
459 /// EFrameworkunifiedStatus - success or error
460 ////////////////////////////////////////////////////////////////////////////////////////////
461 EFrameworkunifiedStatus FrameworkunifiedNPUnsubscribeFromNotifications(HANDLE hApp, const FrameworkunifiedNotificationCallbackHandler *pList,
465 ////////////////////////////////////////////////////////////////////////////////////////////
466 /// FrameworkunifiedNPHSMSubscribeToNotificationsEvents
467 /// API to send message to Notification Service to add multiple subscriptions list for
468 /// that notification
471 /// HANDLE - Handle to the Framework
472 /// \param [in] pList
473 /// FrameworkunifiedNotificationEvent - list of notification events
474 /// \param [in] uiListLength
475 /// UI_32 - number of notification that your subscribing too.
478 /// EFrameworkunifiedStatus - success or error
479 ////////////////////////////////////////////////////////////////////////////////////////////
480 EFrameworkunifiedStatus FrameworkunifiedNPHSMSubscribeToNotificationsEvents(HANDLE hApp, const FrameworkunifiedNotificationEvent *pList,
483 ////////////////////////////////////////////////////////////////////////////////////////////
484 /// FrameworkunifiedNPHSMSubscribeToNotificationEvent
485 /// API to send message to Notification Service to add to subscription list for
486 /// that notification
489 /// HANDLE - Handle to the Framework
490 /// \param [in] pNotification
491 /// PCSTR - Name of Notification
494 /// EFrameworkunifiedStatus - success or error
495 ////////////////////////////////////////////////////////////////////////////////////////////
496 EFrameworkunifiedStatus FrameworkunifiedNPHSMSubscribeToNotificationEvent(HANDLE hApp, PCSTR pNotification);
498 ////////////////////////////////////////////////////////////////////////////////////////////
499 /// FrameworkunifiedNPHSMUnsubscribeFromNotificationEvent
500 /// API to send message to Notification Service to remove from subscription list for
501 /// that notification
504 /// HANDLE - Handle to the Framework
505 /// \param [in] pNotification
506 /// PCSTR - Name of Notification
509 /// EFrameworkunifiedStatus - success or error
510 ////////////////////////////////////////////////////////////////////////////////////////////
511 EFrameworkunifiedStatus FrameworkunifiedNPHSMUnsubscribeFromNotificationEvent(HANDLE hApp, PCSTR pNotification);
513 ////////////////////////////////////////////////////////////////////////////////////////////
514 /// FrameworkunifiedNPHSMUnsubscribeFromNotificationEvents
515 /// API to send message to Notification Service to remove multiple subscriptions list for
516 /// that notification
519 /// HANDLE - Handle to the Framework
520 /// \param [in] pList
521 /// FrameworkunifiedNotificationEvent - list of notification events
522 /// \param [in] uiListLength
523 /// UI_32 - number of notification that your subscribing too.
526 /// EFrameworkunifiedStatus - success or error
527 ////////////////////////////////////////////////////////////////////////////////////////////
528 EFrameworkunifiedStatus FrameworkunifiedNPHSMUnsubscribeFromNotificationEvents(HANDLE hApp, const FrameworkunifiedNotificationEvent *pList,
531 ////////////////////////////////////////////////////////////////////////////////////////////
534 /// \param [in] cAppName
535 /// PCSTR - Application name
538 /// EFrameworkunifiedStatus - success or error
539 ////////////////////////////////////////////////////////////////////////////////////////////
540 EFrameworkunifiedStatus FrameworkunifiedProcessServiceProtocol(HANDLE hApp);
542 EFrameworkunifiedStatus frameworkunifiedAddConnectMonitor(HANDLE hApp, PCSTR serverName, PCSTR clientName);
543 EFrameworkunifiedStatus frameworkunifiedDelConnectMonitorPre(int efd, PCSTR serverName, PCSTR clientName);
544 EFrameworkunifiedStatus frameworkunifiedDelConnectMonitor(HANDLE hApp, PCSTR serverName, PCSTR clientName);
546 ////////////////////////////////////////////////////////////////////////////////////////////
549 /// \param [in] cAppName
550 /// PCSTR - Application name
551 /// \param [out] hApp
552 /// HANDLE& - Reference of application handle
553 /// \param [in] bIsChildThread
554 /// BOOL - child thread
557 /// EFrameworkunifiedStatus - eFrameworkunifiedStatusOK if success
558 /// eFrameworkunifiedStatusFail if invalid app name
559 /// eFrameworkunifiedStatusNullPointer if unable to open message Q handle
560 /// or possible errors from call FrameworkunifiedAttachSystemCallbacksDispatcher/
561 /// FrameworkunifiedAttachLoggerCallbacksDispatcher/
562 /// FrameworkunifiedAttachVersionCallbacksDispatcher
564 ////////////////////////////////////////////////////////////////////////////////////////////
565 EFrameworkunifiedStatus CreateDispatcher(PCSTR cAppName, HANDLE &hApp, BOOL bIsChildThread = FALSE); // NOLINT (readability/nolint)
567 ////////////////////////////////////////////////////////////////////////////////////////////
571 /// HANDLE - Handle to the Framework
574 /// EFrameworkunifiedStatus - success or error
575 ////////////////////////////////////////////////////////////////////////////////////////////
576 EFrameworkunifiedStatus RunDispatcher(HANDLE hApp);
578 ////////////////////////////////////////////////////////////////////////////////////////////
579 /// RunChildDispatcher
580 /// Dispatcher for child thread. Only difference with \ref RunDispatcher is, child dispatcher
581 /// exits when non eFrameworkunifiedStatusOK value by callback function is returned.
582 /// Whereas, \ref RunDispatcher is not supposed to exit.
585 /// HANDLE - Handle to the Framework
588 /// EFrameworkunifiedStatus - success or error
589 ////////////////////////////////////////////////////////////////////////////////////////////
590 EFrameworkunifiedStatus RunChildDispatcher(HANDLE hChildApp);
592 ////////////////////////////////////////////////////////////////////////////////////////////
593 /// IsValidWaitBarrier
595 /// \param [in] wbret
600 ////////////////////////////////////////////////////////////////////////////////////////////
601 bool IsValidWaitBarrier(int wbret);
603 ////////////////////////////////////////////////////////////////////////////////////////////
604 /// setChildThreadSched
606 /// \param [in] policy
607 /// EFrameworkunifiedSchedPolicy - scheduling policy
608 /// \param [in] priority
609 /// SI_32 - scheduling priority
612 /// EFrameworkunifiedStatus - success or error
613 ////////////////////////////////////////////////////////////////////////////////////////////
614 EFrameworkunifiedStatus setChildThreadSched(EFrameworkunifiedSchedPolicy policy, SI_32 priority);
616 ////////////////////////////////////////////////////////////////////////////////////////////
617 /// CreateChildThread
620 /// HANDLE - Handle to the Framework
621 /// \param [in] childName
622 /// PCSTR - Name of child thread to be created
623 /// \param [in] CbInitialize
624 /// CbFuncPtr - Initialize function.
625 /// \param [in] CbShutdown
626 /// CbFuncPtr - Shutdown function.
628 /// const FrameworkunifiedChildThreadAttr * - child thread attribute
629 /// \param [in] CbCreateStateMachine
630 /// CbFuncPtr - Function pointer to create state machine, in case of SM child thread, else NULL
633 /// Non-null value if thread is created else NULL
634 ////////////////////////////////////////////////////////////////////////////////////////////
635 HANDLE CreateChildThread(HANDLE hApp, PCSTR childName, CbFuncPtr CbInitialize, CbFuncPtr CbShutdown,
636 const FrameworkunifiedChildThreadAttr *attr, CbFuncPtr CbCreateStateMachine);
638 ////////////////////////////////////////////////////////////////////////////////////////////
639 /// Child thread attribute initialize
641 /// \param [out] attr
642 /// FrameworkunifiedChildThreadAttr - Child thread attribute
645 /// EFrameworkunifiedStatus - success or error
646 ////////////////////////////////////////////////////////////////////////////////////////////
647 EFrameworkunifiedStatus CreateChildThreadAttrInit(FrameworkunifiedChildThreadAttr *attr);
649 ////////////////////////////////////////////////////////////////////////////////////////////
650 /// Child thread attribute set schedule policy & priority
652 /// \param [out] attr
653 /// FrameworkunifiedChildThreadAttr - Child thread attribute
654 /// \param [int] policy
655 /// EFrameworkunifiedSchedPolicy - Child thread scheduling policy
656 /// \param [in] priority
657 /// SI_32 - Child thread scheduling priority
660 /// EFrameworkunifiedStatus - success or error
661 ////////////////////////////////////////////////////////////////////////////////////////////
662 EFrameworkunifiedStatus CreateChildThreadAttrSetSched(FrameworkunifiedChildThreadAttr *attr, EFrameworkunifiedSchedPolicy policy, SI_32 priority);
664 ////////////////////////////////////////////////////////////////////////////////////////////
666 // Sends eFrameworkunifiedStatusExit status to exits the dispatcher loop to terminate the thread.
669 /// HANDLE - Handle to the Framework
672 /// EFrameworkunifiedStatus - success or error
673 ////////////////////////////////////////////////////////////////////////////////////////////
674 EFrameworkunifiedStatus DestroyThread(HANDLE hApp);
676 #endif // FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_CORE_H_