- Timestamp:
- Jun 17, 2016 3:05:08 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 3 3 /branches/VBox-4.0:70873 4 4 /branches/VBox-4.1:74233,78414,78691,82579,85941,85944-85947,85949-85950,85953,86701,86728,87009 5 /branches/VBox-4.2:82653,86229-86230,86234,86529,91503-91504,91506-91508,91510,91514-91515,91521 5 /branches/VBox-4.2:82653,86229-86230,86234,86529,91503-91504,91506-91508,91510,91514-91515,91521,108112,108114,108127 6 6 /branches/VBox-4.3:89714,91223,94066,94839,94897,95154,95164,95167,95295,95338,95353-95354,95356,95367,95451,95475,95477,95480,95507,95640,95659,95661,95663,98913-98915,99358 7 7 /branches/VBox-4.3/trunk:91223
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 3 3 /branches/VBox-4.0/src/VBox:70873 4 4 /branches/VBox-4.1/src/VBox:74233,78414,78691,81841,82127,85941,85944-85947,85949-85950,85953,86701,86728,87009 5 /branches/VBox-4.2/src/VBox:86229-86230,86234,86529,91503-91504,91506-91508,91510,91514-91515,91521 5 /branches/VBox-4.2/src/VBox:86229-86230,86234,86529,91503-91504,91506-91508,91510,91514-91515,91521,108112,108114,108127 6 6 /branches/VBox-4.3/src/VBox:89714,91223,93628-93629,94066,94839,94897,95154,95164,95167,95295,95338,95353-95354,95356,95367,95451,95475,95477,95480,95507,95640,95659,95661,95663,98913-98914 7 7 /branches/VBox-4.3/trunk/src/VBox:91223
-
- Property svn:mergeinfo
-
trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp
r59158 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 394 394 if (!rc) 395 395 { 396 pthread_attr_destroy(&ThreadAttr); 396 397 /* 397 398 * Wait for the thread to finish. -
trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp
r57358 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 121 121 * Create the condition variable. 122 122 */ 123 pthread_condattr_t CondAttr; 124 rc = pthread_condattr_init(&CondAttr); 123 rc = pthread_cond_init(&pThis->Cond, NULL); 125 124 if (!rc) 126 125 { 127 rc = pthread_cond_init(&pThis->Cond, &CondAttr); 126 /* 127 * Create the semaphore. 128 */ 129 rc = pthread_mutex_init(&pThis->Mutex, NULL); 128 130 if (!rc) 129 131 { 130 /* 131 * Create the semaphore. 132 */ 133 pthread_mutexattr_t MutexAttr; 134 rc = pthread_mutexattr_init(&MutexAttr); 135 if (!rc) 132 ASMAtomicWriteU32(&pThis->u32State, EVENT_STATE_NOT_SIGNALED); 133 ASMAtomicWriteU32(&pThis->cWaiters, 0); 134 pThis->fFlags = fFlags; 135 #ifdef RTSEMEVENT_STRICT 136 if (!pszNameFmt) 136 137 { 137 rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr); 138 if (!rc) 139 { 140 pthread_mutexattr_destroy(&MutexAttr); 141 pthread_condattr_destroy(&CondAttr); 142 143 ASMAtomicWriteU32(&pThis->u32State, EVENT_STATE_NOT_SIGNALED); 144 ASMAtomicWriteU32(&pThis->cWaiters, 0); 145 pThis->fFlags = fFlags; 146 #ifdef RTSEMEVENT_STRICT 147 if (!pszNameFmt) 148 { 149 static uint32_t volatile s_iSemEventAnon = 0; 150 RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 151 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL), 152 "RTSemEvent-%u", ASMAtomicIncU32(&s_iSemEventAnon) - 1); 153 } 154 else 155 { 156 va_list va; 157 va_start(va, pszNameFmt); 158 RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 159 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL), 160 pszNameFmt, va); 161 va_end(va); 162 } 163 pThis->fEverHadSignallers = false; 164 #endif 165 166 *phEventSem = pThis; 167 return VINF_SUCCESS; 168 } 169 170 pthread_mutexattr_destroy(&MutexAttr); 138 static uint32_t volatile s_iSemEventAnon = 0; 139 RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 140 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL), 141 "RTSemEvent-%u", ASMAtomicIncU32(&s_iSemEventAnon) - 1); 171 142 } 172 pthread_cond_destroy(&pThis->Cond); 173 } 174 pthread_condattr_destroy(&CondAttr); 143 else 144 { 145 va_list va; 146 va_start(va, pszNameFmt); 147 RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 148 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL), 149 pszNameFmt, va); 150 va_end(va); 151 } 152 pThis->fEverHadSignallers = false; 153 #endif 154 155 *phEventSem = pThis; 156 return VINF_SUCCESS; 157 } 158 pthread_cond_destroy(&pThis->Cond); 175 159 } 176 160 -
trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
r57358 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 142 142 * Create the semaphore. 143 143 */ 144 pthread_mutexattr_t MutexAttr; 145 rc = pthread_mutexattr_init(&MutexAttr); 144 rc = pthread_mutex_init(&pThis->Mutex, NULL); 146 145 if (!rc) 147 146 { 148 rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr); 149 if (!rc) 147 pthread_condattr_destroy(&CondAttr); 148 149 ASMAtomicXchgU32(&pThis->u32State, EVENTMULTI_STATE_NOT_SIGNALED); 150 ASMAtomicXchgU32(&pThis->cWaiters, 0); 151 #ifdef RTSEMEVENTMULTI_STRICT 152 if (!pszNameFmt) 150 153 { 151 pthread_mutexattr_destroy(&MutexAttr); 152 pthread_condattr_destroy(&CondAttr); 153 154 ASMAtomicXchgU32(&pThis->u32State, EVENTMULTI_STATE_NOT_SIGNALED); 155 ASMAtomicXchgU32(&pThis->cWaiters, 0); 156 #ifdef RTSEMEVENTMULTI_STRICT 157 if (!pszNameFmt) 158 { 159 static uint32_t volatile s_iSemEventMultiAnon = 0; 160 RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 161 true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), 162 "RTSemEventMulti-%u", ASMAtomicIncU32(&s_iSemEventMultiAnon) - 1); 163 } 164 else 165 { 166 va_list va; 167 va_start(va, pszNameFmt); 168 RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 169 true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), 170 pszNameFmt, va); 171 va_end(va); 172 } 173 pThis->fEverHadSignallers = false; 174 #endif 175 176 *phEventMultiSem = pThis; 177 return VINF_SUCCESS; 154 static uint32_t volatile s_iSemEventMultiAnon = 0; 155 RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 156 true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), 157 "RTSemEventMulti-%u", ASMAtomicIncU32(&s_iSemEventMultiAnon) - 1); 178 158 } 179 180 pthread_mutexattr_destroy(&MutexAttr); 159 else 160 { 161 va_list va; 162 va_start(va, pszNameFmt); 163 RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 164 true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), 165 pszNameFmt, va); 166 va_end(va); 167 } 168 pThis->fEverHadSignallers = false; 169 #endif 170 171 *phEventMultiSem = pThis; 172 return VINF_SUCCESS; 181 173 } 174 182 175 pthread_cond_destroy(&pThis->Cond); 183 176 } -
trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
r57358 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 127 127 * Create the semaphore. 128 128 */ 129 pthread_mutexattr_t MutexAttr; 130 rc = pthread_mutexattr_init(&MutexAttr); 129 rc = pthread_mutex_init(&pThis->Mutex, NULL); 131 130 if (!rc) 132 131 { 133 rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr); 134 if (!rc) 132 pThis->Owner = (pthread_t)-1; 133 pThis->cNesting = 0; 134 pThis->u32Magic = RTSEMMUTEX_MAGIC; 135 #ifdef RTSEMMUTEX_STRICT 136 if (!pszNameFmt) 135 137 { 136 pthread_mutexattr_destroy(&MutexAttr); 137 138 pThis->Owner = (pthread_t)-1; 139 pThis->cNesting = 0; 140 pThis->u32Magic = RTSEMMUTEX_MAGIC; 141 #ifdef RTSEMMUTEX_STRICT 142 if (!pszNameFmt) 143 { 144 static uint32_t volatile s_iMutexAnon = 0; 145 RTLockValidatorRecExclInit(&pThis->ValidatorRec, hClass, uSubClass, pThis, 146 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), 147 "RTSemMutex-%u", ASMAtomicIncU32(&s_iMutexAnon) - 1); 148 } 149 else 150 { 151 va_list va; 152 va_start(va, pszNameFmt); 153 RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis, 154 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va); 155 va_end(va); 156 } 157 #endif 158 159 *phMutexSem = pThis; 160 return VINF_SUCCESS; 138 static uint32_t volatile s_iMutexAnon = 0; 139 RTLockValidatorRecExclInit(&pThis->ValidatorRec, hClass, uSubClass, pThis, 140 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), 141 "RTSemMutex-%u", ASMAtomicIncU32(&s_iMutexAnon) - 1); 161 142 } 162 pthread_mutexattr_destroy(&MutexAttr); 143 else 144 { 145 va_list va; 146 va_start(va, pszNameFmt); 147 RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis, 148 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va); 149 va_end(va); 150 } 151 #endif 152 153 *phMutexSem = pThis; 154 return VINF_SUCCESS; 163 155 } 164 156 RTMemFree(pThis); -
trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
r57358 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 113 113 * Create the rwlock. 114 114 */ 115 pthread_rwlockattr_t Attr; 116 rc = pthread_rwlockattr_init(&Attr); 115 rc = pthread_rwlock_init(&pThis->RWLock, NULL); 117 116 if (!rc) 118 117 { 119 rc = pthread_rwlock_init(&pThis->RWLock, &Attr); 120 if (!rc) 118 pThis->u32Magic = RTSEMRW_MAGIC; 119 pThis->cReaders = 0; 120 pThis->cWrites = 0; 121 pThis->cWriterReads = 0; 122 pThis->Writer = (pthread_t)-1; 123 #ifdef RTSEMRW_STRICT 124 bool const fLVEnabled = !(fFlags & RTSEMRW_FLAGS_NO_LOCK_VAL); 125 if (!pszNameFmt) 121 126 { 122 pThis->u32Magic = RTSEMRW_MAGIC; 123 pThis->cReaders = 0; 124 pThis->cWrites = 0; 125 pThis->cWriterReads = 0; 126 pThis->Writer = (pthread_t)-1; 127 #ifdef RTSEMRW_STRICT 128 bool const fLVEnabled = !(fFlags & RTSEMRW_FLAGS_NO_LOCK_VAL); 129 if (!pszNameFmt) 130 { 131 static uint32_t volatile s_iSemRWAnon = 0; 132 uint32_t i = ASMAtomicIncU32(&s_iSemRWAnon) - 1; 133 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, hClass, uSubClass, pThis, 134 fLVEnabled, "RTSemRW-%u", i); 135 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, hClass, uSubClass, pThis, 136 false /*fSignaller*/, fLVEnabled, "RTSemRW-%u", i); 137 } 138 else 139 { 140 va_list va; 141 va_start(va, pszNameFmt); 142 RTLockValidatorRecExclInitV(&pThis->ValidatorWrite, hClass, uSubClass, pThis, 143 fLVEnabled, pszNameFmt, va); 144 va_end(va); 145 va_start(va, pszNameFmt); 146 RTLockValidatorRecSharedInitV(&pThis->ValidatorRead, hClass, uSubClass, pThis, 147 false /*fSignaller*/, fLVEnabled, pszNameFmt, va); 148 va_end(va); 149 } 150 RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core); 151 #endif 152 *phRWSem = pThis; 153 return VINF_SUCCESS; 127 static uint32_t volatile s_iSemRWAnon = 0; 128 uint32_t i = ASMAtomicIncU32(&s_iSemRWAnon) - 1; 129 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, hClass, uSubClass, pThis, 130 fLVEnabled, "RTSemRW-%u", i); 131 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, hClass, uSubClass, pThis, 132 false /*fSignaller*/, fLVEnabled, "RTSemRW-%u", i); 154 133 } 134 else 135 { 136 va_list va; 137 va_start(va, pszNameFmt); 138 RTLockValidatorRecExclInitV(&pThis->ValidatorWrite, hClass, uSubClass, pThis, 139 fLVEnabled, pszNameFmt, va); 140 va_end(va); 141 va_start(va, pszNameFmt); 142 RTLockValidatorRecSharedInitV(&pThis->ValidatorRead, hClass, uSubClass, pThis, 143 false /*fSignaller*/, fLVEnabled, pszNameFmt, va); 144 va_end(va); 145 } 146 RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core); 147 #endif 148 *phRWSem = pThis; 149 return VINF_SUCCESS; 155 150 } 156 151 -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r57358 r61751 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 362 362 if (!rc) 363 363 { 364 pthread_attr_destroy(&ThreadAttr); 364 365 *pNativeThread = (uintptr_t)ThreadId; 365 366 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.