Changeset 1788 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2007 8:02:32 AM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/hgcm/HGCM.cpp
r1730 r1788 699 699 { 700 700 rc = hgcmMsgSend (hMsg); 701 702 if (VBOX_SUCCESS (rc)) 703 { 704 hgcmThreadWait (m_thread); 705 } 701 706 } 702 707 … … 1947 1952 if (VBOX_SUCCESS (rc)) 1948 1953 { 1954 /* Wait for the thread termination. */ 1955 hgcmThreadWait (g_hgcmThread); 1956 1949 1957 hgcmThreadUninit (); 1950 1958 } -
trunk/src/VBox/Main/hgcm/HGCMObjects.cpp
r1779 r1788 209 209 hgcmObjLeave (); 210 210 } 211 else if (rc == VERR_SEM_DESTROYED)212 {213 /* @todo Implement hgcmThreadWait. */214 }215 211 else 216 212 { -
trunk/src/VBox/Main/hgcm/HGCMThread.cpp
r1772 r1788 135 135 HGCMThread (); 136 136 137 int WaitForTermination (void); 138 137 139 int Initialize (HGCMTHREADHANDLE handle, const char *pszThreadName, PFNHGCMTHREAD pfnThread, void *pvUser); 138 140 … … 199 201 200 202 hgcmObjDeleteHandle (pThread->Handle ()); 203 204 pThread->m_thread = NIL_RTTHREAD; 201 205 202 206 LogFlow(("MAIN::hgcmWorkerThreadFunc: completed HGCM thread %p\n", pThread)); … … 231 235 */ 232 236 237 Assert(m_thread == NIL_RTTHREAD); 238 233 239 if (RTCritSectIsInitialized (&m_critsect)) 234 240 { … … 246 252 } 247 253 248 /*249 * Wait for the thread to terminate, but let's not wait forever.250 */251 if ( m_thread != NIL_RTTHREAD252 && !(m_fu32ThreadFlags & HGCMMSG_TF_TERMINATED))253 {254 int rc = RTThreadWait (m_thread, 5000, NULL);255 AssertRC (rc);256 }257 258 254 return; 255 } 256 257 int HGCMThread::WaitForTermination (void) 258 { 259 int rc = VINF_SUCCESS; 260 LogFlowFunc(("\n")); 261 262 if (m_thread != NIL_RTTHREAD) 263 { 264 rc = RTThreadWait (m_thread, 5000, NULL); 265 } 266 267 LogFlowFunc(("rc = %Vrc\n", rc)); 268 return rc; 259 269 } 260 270 … … 648 658 } 649 659 660 int hgcmThreadWait (HGCMTHREADHANDLE hThread) 661 { 662 int rc = VERR_INVALID_HANDLE; 663 LogFlowFunc(("0x%08X\n", hThread)); 664 665 HGCMThread *pThread = (HGCMThread *)hgcmObjReference (hThread, HGCMOBJ_THREAD); 666 667 if (pThread) 668 { 669 rc = pThread->WaitForTermination (); 670 671 hgcmObjDereference (pThread); 672 } 673 674 LogFlowFunc(("rc = %Vrc\n", rc)); 675 return rc; 676 } 677 650 678 int hgcmMsgAlloc (HGCMTHREADHANDLE hThread, HGCMMSGHANDLE *pHandle, uint32_t u32MsgId, PFNHGCMNEWMSGALLOC pfnNewMessage) 651 679 { -
trunk/src/VBox/Main/include/hgcm/HGCMThread.h
r1711 r1788 138 138 int hgcmThreadCreate (HGCMTHREADHANDLE *pHandle, const char *pszThreadName, PFNHGCMTHREAD pfnThread, void *pvUser); 139 139 140 /** Wait for termination of a HGCM worker thread. 141 * 142 * @param handle The HGCM thread handle. 143 * 144 * @return VBox error code 145 */ 146 int hgcmThreadWait (HGCMTHREADHANDLE handle); 147 140 148 /** Allocate a message to be posted to HGCM worker thread. 141 149 *
Note:
See TracChangeset
for help on using the changeset viewer.