Changeset 14944 in vbox
- Timestamp:
- Dec 3, 2008 2:09:42 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40296
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/darwin/PerformanceDarwin.cpp
r12678 r14944 39 39 extern "C" int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize); 40 40 struct proc_taskinfo { 41 uint64_t pti_virtual_size;/* virtual memory size (bytes) */42 uint64_t pti_resident_size;/* resident memory size (bytes) */43 uint64_t pti_total_user;/* total time */44 uint64_tpti_total_system;45 uint64_t pti_threads_user;/* existing threads only */46 uint64_tpti_threads_system;47 int32_t pti_policy;/* default policy for new threads */48 int32_t pti_faults;/* number of page faults */49 int32_t pti_pageins;/* number of actual pageins */50 int32_t pti_cow_faults;/* number of copy-on-write faults */51 int32_t pti_messages_sent;/* number of messages sent */52 int32_t pti_messages_received;/* number of messages received */53 int32_t pti_syscalls_mach;/* number of mach system calls */54 int32_t pti_syscalls_unix;/* number of unix system calls */55 int32_t pti_csw;/* number of context switches */56 int32_t pti_threadnum;/* number of threads in the task */57 int32_t pti_numrunning;/* number of running threads */58 int32_t pti_priority;/* task priority*/41 uint64_t pti_virtual_size; /* virtual memory size (bytes) */ 42 uint64_t pti_resident_size; /* resident memory size (bytes) */ 43 uint64_t pti_total_user; /* total time */ 44 uint64_t pti_total_system; 45 uint64_t pti_threads_user; /* existing threads only */ 46 uint64_t pti_threads_system; 47 int32_t pti_policy; /* default policy for new threads */ 48 int32_t pti_faults; /* number of page faults */ 49 int32_t pti_pageins; /* number of actual pageins */ 50 int32_t pti_cow_faults; /* number of copy-on-write faults */ 51 int32_t pti_messages_sent; /* number of messages sent */ 52 int32_t pti_messages_received; /* number of messages received */ 53 int32_t pti_syscalls_mach; /* number of mach system calls */ 54 int32_t pti_syscalls_unix; /* number of unix system calls */ 55 int32_t pti_csw; /* number of context switches */ 56 int32_t pti_threadnum; /* number of threads in the task */ 57 int32_t pti_numrunning; /* number of running threads */ 58 int32_t pti_priority; /* task priority*/ 59 59 }; 60 60 #define PROC_PIDTASKINFO 4 … … 101 101 mach_msg_type_number_t count; 102 102 host_cpu_load_info_data_t info; 103 103 104 104 count = HOST_CPU_LOAD_INFO_COUNT; 105 105 106 106 krc = host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, (host_info_t)&info, &count); 107 107 if (krc != KERN_SUCCESS) … … 110 110 return RTErrConvertFromDarwinKern(krc); 111 111 } 112 112 113 113 *user = (uint64_t)info.cpu_ticks[CPU_STATE_USER] 114 114 + info.cpu_ticks[CPU_STATE_NICE]; … … 123 123 mach_msg_type_number_t count; 124 124 vm_statistics_data_t info; 125 125 126 126 count = HOST_VM_INFO_COUNT; 127 127 128 128 krc = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&info, &count); 129 129 if (krc != KERN_SUCCESS) -
trunk/src/VBox/Main/glue/initterm.cpp
r14325 r14944 75 75 DirectoryServiceProvider() 76 76 : mCompRegLocation (NULL), mXPTIDatLocation (NULL) 77 77 , mComponentDirLocation (NULL), mCurrProcDirLocation (NULL) 78 78 {} 79 79 … … 82 82 HRESULT init (const char *aCompRegLocation, 83 83 const char *aXPTIDatLocation, 84 85 84 const char *aComponentDirLocation, 85 const char *aCurrProcDirLocation); 86 86 87 87 NS_DECL_NSIDIRECTORYSERVICEPROVIDER … … 128 128 DirectoryServiceProvider::init (const char *aCompRegLocation, 129 129 const char *aXPTIDatLocation, 130 131 130 const char *aComponentDirLocation, 131 const char *aCurrProcDirLocation) 132 132 { 133 133 AssertReturn (aCompRegLocation, NS_ERROR_INVALID_ARG); … … 140 140 vrc = RTStrUtf8ToCurrentCP (&mComponentDirLocation, aComponentDirLocation); 141 141 if (RT_SUCCESS (vrc) && aCurrProcDirLocation) 142 142 vrc = RTStrUtf8ToCurrentCP (&mCurrProcDirLocation, aCurrProcDirLocation); 143 143 144 144 return RT_SUCCESS (vrc) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; … … 163 163 fileLocation = mXPTIDatLocation; 164 164 else if (mComponentDirLocation && strcmp (aProp, NS_XPCOM_COMPONENT_DIR) == 0) 165 165 fileLocation = mComponentDirLocation; 166 166 else if (mCurrProcDirLocation && strcmp (aProp, NS_XPCOM_CURRENT_PROCESS_DIR) == 0) 167 167 fileLocation = mCurrProcDirLocation; 168 168 else 169 169 return NS_ERROR_FAILURE; -
trunk/src/VBox/Main/include/VirtualBoxBase.h
r14717 r14944 58 58 { 59 59 public: 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 60 CMyComClassFactorySingleton() : m_hrCreate(S_OK){} 61 virtual ~CMyComClassFactorySingleton(){} 62 // IClassFactory 63 STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObj) 64 { 65 HRESULT hRes = E_POINTER; 66 if (ppvObj != NULL) 67 { 68 *ppvObj = NULL; 69 // Aggregation is not supported in singleton objects. 70 ATLASSERT(pUnkOuter == NULL); 71 if (pUnkOuter != NULL) 72 hRes = CLASS_E_NOAGGREGATION; 73 else 74 { 75 if (m_hrCreate == S_OK && m_spObj == NULL) 76 { 77 Lock(); 78 __try 79 { 80 // Fix: The following If statement was moved inside the __try statement. 81 // Did another thread arrive here first? 82 if (m_hrCreate == S_OK && m_spObj == NULL) 83 { 84 // lock the module to indicate activity 85 // (necessary for the monitor shutdown thread to correctly 86 // terminate the module in case when CreateInstance() fails) 87 _pAtlModule->Lock(); 88 CComObjectCached<T> *p; 89 m_hrCreate = CComObjectCached<T>::CreateInstance(&p); 90 if (SUCCEEDED(m_hrCreate)) 91 { 92 m_hrCreate = p->QueryInterface(IID_IUnknown, (void**)&m_spObj); 93 if (FAILED(m_hrCreate)) 94 { 95 delete p; 96 } 97 } 98 _pAtlModule->Unlock(); 99 } 100 } 101 __finally 102 { 103 Unlock(); 104 } 105 } 106 if (m_hrCreate == S_OK) 107 { 108 hRes = m_spObj->QueryInterface(riid, ppvObj); 109 } 110 else 111 { 112 hRes = m_hrCreate; 113 } 114 } 115 } 116 return hRes; 117 } 118 HRESULT m_hrCreate; 119 CComPtr<IUnknown> m_spObj; 120 120 }; 121 121
Note:
See TracChangeset
for help on using the changeset viewer.