Changeset 5324 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Oct 16, 2007 11:51:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/sems-posix.cpp
r4071 r5324 725 725 pthread_mutexattr_destroy(&MutexAttr); 726 726 727 pIntMutexSem->Owner = (pthread_t)~0;727 pIntMutexSem->Owner = ~(pthread_t)0; 728 728 pIntMutexSem->cNesting = 0; 729 729 … … 767 767 * Free the memory and be gone. 768 768 */ 769 pIntMutexSem->Owner = (pthread_t)~0;769 pIntMutexSem->Owner = ~(pthread_t)0; 770 770 pIntMutexSem->cNesting = ~0; 771 771 RTMemTmpFree(pIntMutexSem); … … 789 789 * Check if nested request. 790 790 */ 791 pthread_t 791 pthread_t Self = pthread_self(); 792 792 struct RTSEMMUTEXINTERNAL *pIntMutexSem = MutexSem; 793 793 if ( pIntMutexSem->Owner == Self … … 874 874 * Check if nested. 875 875 */ 876 pthread_t 876 pthread_t Self = pthread_self(); 877 877 struct RTSEMMUTEXINTERNAL *pIntMutexSem = MutexSem; 878 878 if ( pIntMutexSem->Owner != Self … … 896 896 * Clear the state. (cNesting == 1) 897 897 */ 898 pIntMutexSem->Owner = (pthread_t)~0;898 pIntMutexSem->Owner = ~(pthread_t)0; 899 899 ASMAtomicXchgU32(&pIntMutexSem->cNesting, 0); 900 900 … … 956 956 { 957 957 pIntRWSem->uCheck = ~0; 958 pIntRWSem->WROwner = (pthread_t)~0;958 pIntRWSem->WROwner = ~(pthread_t)0; 959 959 *pRWSem = pIntRWSem; 960 960 return VINF_SUCCESS; … … 1160 1160 } 1161 1161 1162 ASMAtomicXchg Ptr((void * volatile *)&pIntRWSem->WROwner, (void *)pthread_self());1162 ASMAtomicXchgSize(&pIntRWSem->WROwner, pthread_self()); 1163 1163 1164 1164 return VINF_SUCCESS; … … 1187 1187 * Try unlock it. 1188 1188 */ 1189 pthread_t 1189 pthread_t Self = pthread_self(); 1190 1190 struct RTSEMRWINTERNAL *pIntRWSem = RWSem; 1191 1191 if (pIntRWSem->WROwner != Self) … … 1198 1198 * Try unlock it. 1199 1199 */ 1200 AssertMsg(sizeof(pthread_t) == sizeof(void *), ("pthread_t is not the size of a pointer but %d bytes\n", sizeof(pthread_t))); 1201 ASMAtomicXchgPtr((void * volatile *)&pIntRWSem->WROwner, (void *)(uintptr_t)~0); 1200 ASMAtomicXchgSize(&pIntRWSem->WROwner, ~(pthread_t)0); 1202 1201 int rc = pthread_rwlock_unlock(&pIntRWSem->RWLock); 1203 1202 if (rc)
Note:
See TracChangeset
for help on using the changeset viewer.