Changeset 3480 in vbox
- Timestamp:
- Jul 5, 2007 3:48:41 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 22692
- Location:
- trunk/src/VBox/Main
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r3424 r3480 7383 7383 #if defined(__WIN__) 7384 7384 mIPCSem = NULL; 7385 #elif defined(__OS2__) 7386 mIPCSem = NULLHANDLE; 7385 7387 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7386 7388 mIPCSem = -1; 7389 #else 7390 # error "Port me!" 7387 7391 #endif 7388 7392 … … 7420 7424 mIPCSemName[i] = '/'; 7421 7425 mIPCSem = ::CreateMutex (NULL, FALSE, mIPCSemName); 7422 ComAssertMsgRet (mIPCSem, ("Cannot create IPC mutex, err=0x%08X", ::GetLastError()), 7426 ComAssertMsgRet (mIPCSem, 7427 ("Cannot create IPC mutex '%ls', err=%d\n", 7428 mIPCSemName.raw(), ::GetLastError()), 7429 E_FAIL); 7430 #elif defined(__OS2__) 7431 Utf8Str ipcSem = Utf8StrFmt ("\\SEM32\\VBOX\\VM\\{%Vuuid}", 7432 aMachine->mData->mUuid.raw()); 7433 mIPCSemName = ipcSem; 7434 APIRET arc = ::DosCreateMutexSem ((PSZ) ipcSem.raw(), &mIPCSem, 0, FALSE); 7435 ComAssertMsgRet (arc == NO_ERROR, 7436 ("Cannot create IPC mutex '%s', arc=%ld\n", 7437 ipcSem.raw(), arc), 7423 7438 E_FAIL); 7424 7439 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7425 7440 Utf8Str configFile = aMachine->mData->mConfigFileFull; 7426 char * pszConfigFile= NULL;7427 RTStrUtf8ToCurrentCP (& pszConfigFile, configFile);7428 key_t key = ::ftok ( pszConfigFile, 0);7429 RTStrFree ( pszConfigFile);7441 char *configFileCP = NULL; 7442 RTStrUtf8ToCurrentCP (&configFileCP, configFile); 7443 key_t key = ::ftok (configFileCP, 0); 7444 RTStrFree (configFileCP); 7430 7445 mIPCSem = ::semget (key, 1, S_IRWXU | S_IRWXG | S_IRWXO | IPC_CREAT); 7431 7446 ComAssertMsgRet (mIPCSem >= 0, ("Cannot create IPC semaphore, errno=%d", errno), … … 7435 7450 ComAssertMsgRet (rv == 0, ("Cannot init IPC semaphore, errno=%d", errno), 7436 7451 E_FAIL); 7452 #else 7453 # error "Port me!" 7437 7454 #endif 7438 7455 … … 7526 7543 ::CloseHandle (mIPCSem); 7527 7544 mIPCSem = NULL; 7545 #elif defined(__OS2__) 7546 if (mIPCSem != NULLHANDLE) 7547 ::DosCloseMutexSem (mIPCSem); 7548 mIPCSem = NULLHANDLE; 7528 7549 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7529 7550 if (mIPCSem >= 0) 7530 7551 ::semctl (mIPCSem, 0, IPC_RMID); 7531 7552 mIPCSem = -1; 7553 #else 7554 # error "Port me!" 7532 7555 #endif 7533 7556 uninitDataAndChildObjects(); … … 7668 7691 ::CloseHandle (mIPCSem); 7669 7692 mIPCSem = NULL; 7693 #elif defined(__OS2__) 7694 if (mIPCSem != NULLHANDLE) 7695 ::DosCloseMutexSem (mIPCSem); 7696 mIPCSem = NULLHANDLE; 7670 7697 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 7671 7698 if (mIPCSem >= 0) 7672 7699 ::semctl (mIPCSem, 0, IPC_RMID); 7673 7700 mIPCSem = -1; 7701 #else 7702 # error "Port me!" 7674 7703 #endif 7675 7704 … … 7722 7751 AutoReaderLock alock (this); 7723 7752 7724 #if defined(__WIN__) 7753 #if defined(__WIN__) || defined(__OS2__) 7725 7754 mIPCSemName.cloneTo (id); 7726 7755 return S_OK; … … 7729 7758 return S_OK; 7730 7759 #else 7731 return S_FAIL; 7760 # error "Port me!" 7732 7761 #endif 7733 7762 } … … 8431 8460 * process death. 8432 8461 * 8433 * @note On Win32, this method is called only when we've got the semaphore 8434 * (i.e. it has been signaled when we were waiting for it). 8435 * 8436 * On Win32, this method always returns true. 8437 * 8438 * On Linux, the method returns true if the client process has terminated 8439 * abnormally (and/or the session has been uninitialized) and false if it is 8440 * still alive. 8462 * @note On Win32 and on OS/2, this method is called only when we've got the 8463 * mutex (i.e. the client has either died or terminated normally). This 8464 * method always returns true. 8465 * 8466 * @note On Linux, the method returns true if the client process has 8467 * terminated abnormally (and/or the session has been uninitialized) and 8468 * false if it is still alive. 8441 8469 * 8442 8470 * @note Locks this object for writing. … … 8446 8474 Uninit::Reason reason; 8447 8475 bool doUninit = false; 8448 bool r c= false;8476 bool ret = false; 8449 8477 8450 8478 /* … … 8488 8516 doUninit = true; 8489 8517 8490 rc = true; 8518 ret = true; 8519 8520 #elif defined(__OS2__) 8521 8522 AssertMsg (mIPCSem, ("semaphore must be created")); 8523 8524 /* release the IPC mutex */ 8525 ::DosReleaseMutexSem (mIPCSem); 8526 8527 doUninit = true; 8528 8529 ret = true; 8491 8530 8492 8531 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) … … 8501 8540 } 8502 8541 8503 rc = val > 0; 8504 8542 ret = val > 0; 8543 8544 #else 8545 # error "Port me!" 8505 8546 #endif 8506 8547 … … 8510 8551 uninit (reason); 8511 8552 8512 return r c;8553 return ret; 8513 8554 } 8514 8555 -
trunk/src/VBox/Main/Makefile.kmk
r3278 r3480 37 37 endif 38 38 DLLS += VBoxSVCM 39 DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER 39 ifneq ($(BUILD_TARGET),os2) 40 DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER 41 endif 40 42 DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING 41 43 endif -
trunk/src/VBox/Main/SessionImpl.cpp
r3001 r3480 40 40 #include <iprt/process.h> 41 41 42 #if defined(__WIN__) 42 #if defined(__WIN__) || defined (__OS2__) 43 43 /** VM IPC mutex holder thread */ 44 44 static DECLCALLBACK(int) IPCMutexHolderThread (RTTHREAD Thread, void *pvUser); … … 94 94 mIPCSem = NULL; 95 95 mIPCThreadSem = NULL; 96 #elif defined(__OS2__) 97 mIPCThread = NIL_RTTHREAD; 98 mIPCThreadSem = NIL_RTSEMEVENT; 96 99 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 97 100 mIPCSem = -1; 101 #else 102 # error "Port me!" 98 103 #endif 99 104 … … 645 650 #if defined(__WIN__) 646 651 Assert (!mIPCSem && !mIPCThreadSem); 652 #elif defined(__OS2__) 653 Assert (mIPCThread == NIL_RTTHREAD && 654 mIPCThreadSem == NIL_RTSEMEVENT); 647 655 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 648 656 Assert (mIPCSem == -1); 657 #else 658 # error "Port me!" 649 659 #endif 650 660 LogFlowThisFuncLeave(); … … 741 751 Bstr ipcId; 742 752 rc = mControl->GetIPCId (ipcId.asOutParam()); 743 AssertComRCReturn (rc,rc);744 745 LogFlowThisFunc (("ipcId : {%ls}\n", ipcId.raw()));753 AssertComRCReturnRC (rc); 754 755 LogFlowThisFunc (("ipcId='%ls'\n", ipcId.raw())); 746 756 747 757 #if defined(__WIN__) … … 764 774 data [2] = 0; /* will get an output from the thread */ 765 775 766 /* create thethread to hold the IPC mutex until signalled to release it */776 /* create a thread to hold the IPC mutex until signalled to release it */ 767 777 RTTHREAD tid; 768 778 int vrc = RTThreadCreate (&tid, IPCMutexHolderThread, (void *) data, … … 772 782 /* wait until thread init is completed */ 773 783 DWORD wrc = ::WaitForSingleObject (mIPCThreadSem, INFINITE); 774 AssertMsg (wrc == WAIT_OBJECT_0, ("Wait failed, err=%d ", ::GetLastError()));784 AssertMsg (wrc == WAIT_OBJECT_0, ("Wait failed, err=%d\n", ::GetLastError())); 775 785 Assert (data [2]); 776 786 … … 787 797 rc = E_FAIL; 788 798 } 799 800 #elif defined(__OS2__) 801 802 /* We use XPCOM where any message (including close()) can arrive on any 803 * worker thread (which will not necessarily match this thread that opens 804 * the mutex). Therefore, we need a separate thread to hold the IPC mutex 805 * and then release it in close(). */ 806 807 int vrc = RTSemEventCreate (&mIPCThreadSem); 808 AssertRCReturn (vrc, E_FAIL); 809 810 void *data [3]; 811 data [0] = (void *) ipcId.raw(); 812 data [1] = (void *) mIPCThreadSem; 813 data [2] = (void *) false; /* will get the thread result here */ 814 815 /* create a thread to hold the IPC mutex until signalled to release it */ 816 vrc = RTThreadCreate (&mIPCThread, IPCMutexHolderThread, (void *) data, 817 0, RTTHREADTYPE_MAIN_WORKER, 0, "IPCHolder"); 818 AssertRCReturn (vrc, E_FAIL); 819 820 /* wait until thread init is completed */ 821 vrc = RTThreadUserWait (mIPCThread, RT_INDEFINITE_WAIT); 822 AssertReturn (VBOX_SUCCESS (vrc) || vrc == VERR_INTERRUPTED, E_FAIL); 823 824 /* the thread must succeed */ 825 AssertReturn ((bool) data [2], E_FAIL); 789 826 790 827 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) … … 808 845 E_FAIL); 809 846 847 #else 848 # error "Port me!" 810 849 #endif 811 850 … … 818 857 /* release the IPC semaphore */ 819 858 #if defined(__WIN__) 859 820 860 if (mIPCSem && mIPCThreadSem) 821 861 { 822 862 /* 823 * saythe thread holding the IPC mutex to release it;863 * tell the thread holding the IPC mutex to release it; 824 864 * it will close mIPCSem handle 825 865 */ … … 829 869 ::CloseHandle (mIPCThreadSem); 830 870 } 871 872 #elif defined(__OS2__) 873 874 if (mIPCThread != NIL_RTTHREAD) 875 { 876 Assert (mIPCThreadSem != NIL_RTSEMEVENT); 877 878 /* tell the thread holding the IPC mutex to release it */ 879 int vrc = RTSemEventSignal (mIPCThreadSem); 880 AssertRC (vrc == NO_ERROR); 881 882 /* wait for the thread to finish */ 883 vrc = RTThreadUserWait (mIPCThread, RT_INDEFINITE_WAIT); 884 Assert (VBOX_SUCCESS (vrc) || vrc == VERR_INTERRUPTED); 885 886 mIPCThread = NIL_RTTHREAD; 887 } 888 889 if (mIPCThreadSem != NIL_RTSEMEVENT) 890 { 891 RTSemEventDestroy (mIPCThreadSem); 892 mIPCThreadSem = NIL_RTSEMEVENT; 893 } 894 831 895 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 896 832 897 if (mIPCSem >= 0) 833 898 { … … 835 900 ::semop (mIPCSem, &sop, 1); 836 901 } 902 903 #else 904 # error "Port me!" 837 905 #endif 838 906 } … … 851 919 852 920 HANDLE ipcMutex = ::OpenMutex (MUTEX_ALL_ACCESS, FALSE, sessionId); 853 AssertMsg (ipcMutex, ("cannot open IPC mutex, err=% 08X\n", ::GetLastError()));921 AssertMsg (ipcMutex, ("cannot open IPC mutex, err=%d\n", ::GetLastError())); 854 922 855 923 if (ipcMutex) … … 888 956 #endif 889 957 958 #if defined(__OS2__) 959 /** VM IPC mutex holder thread */ 960 DECLCALLBACK(int) IPCMutexHolderThread (RTTHREAD Thread, void *pvUser) 961 { 962 LogFlowFuncEnter(); 963 964 Assert (pvUser); 965 void **data = (void **) pvUser; 966 967 Utf8Str ipcId = (BSTR) data [0]; 968 RTSEMEVENT finishSem = (RTSEMEVENT) data [1]; 969 970 LogFlowFunc (("ipcId='%s', finishSem=%p\n", ipcId.raw(), finishSem)); 971 972 HMTX ipcMutex = NULLHANDLE; 973 APIRET arc = ::DosOpenMutexSem ((PSZ) ipcId.raw(), &ipcMutex); 974 AssertMsg (arc == NO_ERROR, ("cannot open IPC mutex, arc=%ld\n", arc)); 975 976 if (arc == NO_ERROR) 977 { 978 /* grab the mutex */ 979 LogFlowFunc (("grabbing IPC mutex...\n")); 980 arc = ::DosRequestMutexSem (ipcMutex, SEM_IMMEDIATE_RETURN); 981 AssertMsg (arc == NO_ERROR, ("cannot grab IPC mutex, arc=%ld\n", arc)); 982 if (arc == NO_ERROR) 983 { 984 /* store the answer */ 985 data [2] = (void *) true; 986 /* signal we're done */ 987 int vrc = RTThreadUserSignal (Thread); 988 AssertRC (vrc); 989 990 /* wait until we're signaled to release the IPC mutex */ 991 LogFlowFunc (("waiting for termination signal..\n")); 992 vrc = RTSemEventWait (finishSem, RT_INDEFINITE_WAIT); 993 Assert (arc == ERROR_INTERRUPT || ERROR_TIMEOUT); 994 995 /* release the IPC mutex */ 996 LogFlowFunc (("releasing IPC mutex...\n")); 997 arc = ::DosReleaseMutexSem (ipcMutex); 998 AssertMsg (arc == NO_ERROR, ("cannot release mutex, arc=%ld\n", arc)); 999 } 1000 } 1001 1002 /* store the answer */ 1003 data [1] = (void *) false; 1004 /* signal we're done */ 1005 int vrc = RTThreadUserSignal (Thread); 1006 AssertRC (vrc); 1007 1008 LogFlowFuncLeave(); 1009 1010 return 0; 1011 } 1012 #endif -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r3387 r3480 278 278 #if defined(__WIN__) 279 279 unconst (mWatcherData.mUpdateReq) = ::CreateEvent (NULL, FALSE, FALSE, NULL); 280 #elif defined(__OS2__) 281 RTSemEventCreate (&unconst (mWatcherData.mUpdateReq)); 282 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 283 RTSemEventCreate (&unconst (mWatcherData.mUpdateReq)); 280 284 #else 281 RTSemEventCreate (&unconst (mWatcherData.mUpdateReq)); 285 # error "Port me!" 282 286 #endif 283 287 int vrc = RTThreadCreate (&unconst (mWatcherData.mThread), 284 clientWatcher, (void *) this,288 ClientWatcher, (void *) this, 285 289 0, RTTHREADTYPE_MAIN_WORKER, 286 290 RTTHREADFLAGS_WAITABLE, "Watcher"); … … 293 297 { 294 298 /* start the async event handler thread */ 295 int vrc = RTThreadCreate (&unconst (mAsyncEventThread), asyncEventHandler,299 int vrc = RTThreadCreate (&unconst (mAsyncEventThread), AsyncEventHandler, 296 300 &unconst (mAsyncEventQ), 297 301 0, RTTHREADTYPE_MAIN_WORKER, … … 419 423 unconst (mWatcherData.mUpdateReq) = NULL; 420 424 } 421 #el se425 #elif defined(__OS2__) 422 426 if (mWatcherData.mUpdateReq != NIL_RTSEMEVENT) 423 427 { … … 425 429 unconst (mWatcherData.mUpdateReq) = NIL_RTSEMEVENT; 426 430 } 431 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 432 if (mWatcherData.mUpdateReq != NIL_RTSEMEVENT) 433 { 434 RTSemEventDestroy (mWatcherData.mUpdateReq); 435 unconst (mWatcherData.mUpdateReq) = NIL_RTSEMEVENT; 436 } 437 #else 438 # error "Port me!" 427 439 #endif 428 440 … … 2394 2406 #if defined(__WIN__) 2395 2407 ::SetEvent (mWatcherData.mUpdateReq); 2408 #elif defined(__OS2__) 2409 RTSemEventSignal (mWatcherData.mUpdateReq); 2410 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 2411 RTSemEventSignal (mWatcherData.mUpdateReq); 2396 2412 #else 2397 RTSemEventSignal (mWatcherData.mUpdateReq); 2413 # error "Port me!" 2398 2414 #endif 2399 2415 } … … 4347 4363 */ 4348 4364 // static 4349 DECLCALLBACK(int) VirtualBox:: clientWatcher (RTTHREAD thread, void *pvUser)4365 DECLCALLBACK(int) VirtualBox::ClientWatcher (RTTHREAD thread, void *pvUser) 4350 4366 { 4351 4367 LogFlowFuncEnter(); … … 4355 4371 4356 4372 SessionMachineVector machines; 4357 int cnt = 0;4373 size_t cnt = 0; 4358 4374 4359 4375 #if defined(__WIN__) … … 4437 4453 ::CoUninitialize(); 4438 4454 4439 #else 4440 4441 bool need_update = false; 4455 #elif defined (__OS2__) 4456 4457 /// @todo (dmik) processes reaping! 4458 4459 /* according to PMREF, 64 is the maximum for the muxwait list */ 4460 SEMRECORD handles [64]; 4461 4462 HMUX muxSem = NULLHANDLE; 4442 4463 4443 4464 do 4444 4465 { 4445 4466 AutoCaller autoCaller (that); 4467 /* VirtualBox has been early uninitialized, terminate */ 4446 4468 if (!autoCaller.isOk()) 4447 4469 break; … … 4452 4474 autoCaller.release(); 4453 4475 4454 int rc = RTSemEventWait (that->mWatcherData.mUpdateReq, 500);4476 int vrc = RTSemEventWait (that->mWatcherData.mUpdateReq, 500); 4455 4477 4456 4478 /* … … 4462 4484 break; 4463 4485 4486 bool update = false; 4487 4488 if (VBOX_SUCCESS (vrc)) 4489 { 4490 /* update event is signaled */ 4491 update = true; 4492 } 4493 else 4494 { 4495 AssertMsg (vrc == VERR_TIMEOUT || vrc == VERR_INTERRUPTED, 4496 ("RTSemEventWait returned %Vrc\n", vrc)); 4497 4498 /* are there any mutexes? */ 4499 if (cnt > 0) 4500 { 4501 /* figure out what's going on with machines */ 4502 4503 unsigned long semId = 0; 4504 APIRET arc = ::DosWaitMuxWaitSem (muxSem, 4505 SEM_IMMEDIATE_RETURN, &semId); 4506 4507 if (arc == NO_ERROR) 4508 { 4509 /* machine mutex is normally released */ 4510 Assert (semId >= 0 && semId < cnt); 4511 if (semId >= 0 && semId < cnt) 4512 machines [semId]->checkForDeath(); 4513 update = true; 4514 } 4515 else if (arc == ERROR_SEM_OWNER_DIED) 4516 { 4517 /* machine mutex is abandoned due to client process 4518 * termination; find which mutex is in the Owner Died 4519 * state */ 4520 for (size_t i = 0; i < cnt; ++ i) 4521 { 4522 PID pid; TID tid; 4523 unsigned long reqCnt; 4524 arc = DosQueryMutexSem ((HMTX) handles [i].hsemCur, &pid, 4525 &tid, &reqCnt); 4526 if (arc == ERROR_SEM_OWNER_DIED) 4527 { 4528 /* close the dead mutex as asked by PMREF */ 4529 ::DosCloseMutexSem ((HMTX) handles [i].hsemCur); 4530 4531 Assert (i >= 0 && i < cnt); 4532 if (i >= 0 && i < cnt) 4533 machines [i]->checkForDeath(); 4534 } 4535 } 4536 update = true; 4537 } 4538 else 4539 AssertMsg (arc == ERROR_INTERRUPT || arc == ERROR_TIMEOUT, 4540 ("DosWaitMuxWaitSem returned %d\n", arc)); 4541 } 4542 } 4543 4544 if (update) 4545 { 4546 /* close the old muxsem */ 4547 if (muxSem != NULLHANDLE) 4548 ::DosCloseMuxWaitSem (muxSem); 4549 /* obtain a new set of opened machines */ 4550 that->getOpenedMachines (machines); 4551 cnt = machines.size(); 4552 LogFlowFunc (("UPDATE: direct session count = %d\n", cnt)); 4553 /// @todo use several muxwait sems if cnt is > 64 4554 AssertMsg (cnt <= 64 /* according to PMREF */, 4555 ("maximum of 64 mutex semaphores reached (%d)", cnt)); 4556 if (cnt > 64) 4557 cnt = 64; 4558 if (cnt > 0) 4559 { 4560 /* renew the set of event handles */ 4561 for (size_t i = 0; i < cnt; ++ i) 4562 { 4563 handles [i].hsemCur = (HSEM) machines [i]->ipcSem(); 4564 handles [i].ulUser = i; 4565 } 4566 /* create a new muxsem */ 4567 APIRET arc = ::DosCreateMuxWaitSem (NULL, &muxSem, cnt, handles, 4568 DCMW_WAIT_ANY); 4569 AssertMsg (arc == NO_ERROR, 4570 ("DosCreateMuxWaitSem returned %d\n", arc)); 4571 } 4572 } 4573 } 4574 while (true); 4575 } 4576 while (0); 4577 4578 /* close the muxsem */ 4579 if (muxSem != NULLHANDLE) 4580 ::DosCloseMuxWaitSem (muxSem); 4581 4582 /* delete the set of opened machines if any */ 4583 machines.clear(); 4584 4585 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 4586 4587 bool need_update = false; 4588 4589 do 4590 { 4591 AutoCaller autoCaller (that); 4592 if (!autoCaller.isOk()) 4593 break; 4594 4595 do 4596 { 4597 /* release the caller to let uninit() ever proceed */ 4598 autoCaller.release(); 4599 4600 int rc = RTSemEventWait (that->mWatcherData.mUpdateReq, 500); 4601 4602 /* 4603 * Restore the caller before using VirtualBox. If it fails, this 4604 * means VirtualBox is being uninitialized and we must terminate. 4605 */ 4606 autoCaller.add(); 4607 if (!autoCaller.isOk()) 4608 break; 4609 4464 4610 if (VBOX_SUCCESS (rc) || need_update) 4465 4611 { … … 4473 4619 4474 4620 need_update = false; 4475 for ( int i = 0; i < cnt; i++)4621 for (size_t i = 0; i < cnt; ++ i) 4476 4622 need_update |= (machines [i])->checkForDeath(); 4477 4623 … … 4522 4668 machines.clear(); 4523 4669 4670 #else 4671 # error "Port me!" 4524 4672 #endif 4525 4673 … … 4532 4680 */ 4533 4681 // static 4534 DECLCALLBACK(int) VirtualBox:: asyncEventHandler (RTTHREAD thread, void *pvUser)4682 DECLCALLBACK(int) VirtualBox::AsyncEventHandler (RTTHREAD thread, void *pvUser) 4535 4683 { 4536 4684 LogFlowFuncEnter(); -
trunk/src/VBox/Main/include/MachineImpl.h
r3424 r3480 756 756 757 757 bool checkForDeath(); 758 #ifdef __WIN__ 758 759 #if defined (__WIN__) 759 760 HANDLE ipcSem() { return mIPCSem; } 761 #elif defined (__OS2__) 762 HMTX ipcSem() { return mIPCSem; } 760 763 #endif 761 764 … … 821 824 HANDLE mIPCSem; 822 825 Bstr mIPCSemName; 826 #elif defined(__OS2__) 827 HMTX mIPCSem; 828 Bstr mIPCSemName; 823 829 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 824 830 int mIPCSem; 831 #else 832 # error "Port me!" 825 833 #endif 826 834 -
trunk/src/VBox/Main/include/SessionImpl.h
r3001 r3480 125 125 ComPtr <IVirtualBox> mVirtualBox; 126 126 127 / / the interprocess semaphore handle (id) for the opened machine127 /* interprocess semaphore handle (id) for the opened machine */ 128 128 #if defined(__WIN__) 129 129 HANDLE mIPCSem; 130 130 HANDLE mIPCThreadSem; 131 #elif defined(__OS2__) 132 RTTHREAD mIPCThread; 133 RTSEMEVENT mIPCThreadSem; 131 134 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 132 135 int mIPCSem; 133 136 #else 134 # error "P ORTME"137 # error "Port me!" 135 138 #endif 136 139 }; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r2981 r3480 356 356 #if defined(__WIN__) 357 357 : mUpdateReq (NULL) 358 #elif defined(__OS2__) 359 : mUpdateReq (NIL_RTSEMEVENT) 360 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 361 : mUpdateReq (NIL_RTSEMEVENT) 358 362 #else 359 : mUpdateReq (NIL_RTSEMEVENT) 363 # error "Port me!" 360 364 #endif 361 365 , mThread (NIL_RTTHREAD) {} … … 364 368 #if defined(__WIN__) 365 369 const HANDLE mUpdateReq; 370 #elif defined(__OS2__) 371 const RTSEMEVENT mUpdateReq; 372 #elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER) 373 const RTSEMEVENT mUpdateReq; 366 374 #else 367 const RTSEMEVENT mUpdateReq; 375 # error "Port me!" 368 376 #endif 369 377 const RTTHREAD mThread; … … 382 390 static Bstr sVersion; 383 391 384 static DECLCALLBACK(int) clientWatcher (RTTHREAD thread, void *pvUser);385 static DECLCALLBACK(int) asyncEventHandler (RTTHREAD thread, void *pvUser);392 static DECLCALLBACK(int) ClientWatcher (RTTHREAD thread, void *pvUser); 393 static DECLCALLBACK(int) AsyncEventHandler (RTTHREAD thread, void *pvUser); 386 394 387 395 #ifdef __WIN__ -
trunk/src/VBox/Main/testcase/Makefile.kmk
r3186 r3480 27 27 PROGRAMS.linux = tstVBoxAPILinux 28 28 PROGRAMS.win = tstVBoxAPIWin 29 else ifeq ($(USER),dmik) 30 PROGRAMS = tstAPI 29 31 endif # VBOX_WITH_TESTCASES 30 32 -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r3422 r3480 705 705 #endif 706 706 707 #if 0707 #if 1 708 708 // open a (direct) session 709 709 /////////////////////////////////////////////////////////////////////////// … … 718 718 printf ("Opening a session for this machine...\n"); 719 719 CHECK_RC_BREAK (virtualBox->OpenSession (session, guid)); 720 #if 0720 #if 1 721 721 ComPtr <IMachine> sessionMachine; 722 722 printf ("Getting sessioned machine object...\n"); … … 763 763 } 764 764 #endif 765 printf("Press enter to close session..."); 766 getchar(); 765 767 session->Close(); 766 768 }
Note:
See TracChangeset
for help on using the changeset viewer.