Changeset 25723 in vbox
- Timestamp:
- Jan 11, 2010 2:28:57 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/semaphore.h
r25722 r25723 668 668 * 669 669 * @returns iprt status code. 670 * @param RWSem The Read/Write semaphore to destroy. 671 */ 672 RTDECL(int) RTSemRWDestroy(RTSEMRW RWSem); 670 * @param hRWSem Handle to the read/write semaphore. NIL is 671 * quitly ignored (VINF_SUCCESS). 672 */ 673 RTDECL(int) RTSemRWDestroy(RTSEMRW hRWSem); 673 674 674 675 /** … … 681 682 * lock validator isn't compiled in or either of the parameters are 682 683 * invalid. 683 * @param hRWSem The handle to the read/write semaphore.684 * @param hRWSem Handle to the read/write semaphore. 684 685 * @param uSubClass The new sub-class value. 685 686 */ … … 692 693 * @retval VINF_SUCCESS on success. 693 694 * @retval VERR_INTERRUPT if the wait was interrupted. 694 * @retval VERR_INVALID_HANDLE if RWSem is invalid.695 * 696 * @param RWSem The Read/Write semaphore to request read access to.697 * @param cMillies The number of milliseconds to wait.698 */ 699 RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies);695 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 696 * 697 * @param hRWSem Handle to the read/write semaphore. 698 * @param cMillies The number of milliseconds to wait. 699 */ 700 RTDECL(int) RTSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies); 700 701 701 702 /** … … 705 706 * @retval VINF_SUCCESS on success. 706 707 * @retval VERR_INTERRUPT if the wait was interrupted. 707 * @retval VERR_INVALID_HANDLE if RWSem is invalid.708 * 709 * @param RWSem The Read/Write semaphore to request read access to.710 * @param cMillies The number of milliseconds to wait.711 */ 712 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW RWSem, unsignedcMillies);708 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 709 * 710 * @param hRWSem Handle to the read/write semaphore. 711 * @param cMillies The number of milliseconds to wait. 712 */ 713 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies); 713 714 714 715 /** … … 718 719 * @retval VINF_SUCCESS on success. 719 720 * @retval VERR_INTERRUPT if the wait was interrupted. 720 * @retval VERR_INVALID_HANDLE if RWSem is invalid. 721 * 722 * @param RWSem The Read/Write semaphore to request read access to. 723 * @param cMillies The number of milliseconds to wait. 724 * @param uId Some kind of locking location ID. Typically a 725 * return address up the stack. Optional (0). 726 * @param pszFile The file where the lock is being acquired from. 727 * Optional. 728 * @param iLine The line number in that file. Optional (0). 729 * @param pszFunction The functionn where the lock is being acquired 730 * from. Optional. 731 */ 732 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 733 734 /** 735 * Debug version of RTSemRWRequestWriteNoResume that tracks the location. 736 * 737 * @returns iprt status code. 738 * @retval VINF_SUCCESS on success. 739 * @retval VERR_INTERRUPT if the wait was interrupted. 740 * @retval VERR_INVALID_HANDLE if RWSem is invalid. 741 * 742 * @param RWSem The Read/Write semaphore to request read access to. 743 * @param cMillies The number of milliseconds to wait. 744 * @param uId Some kind of locking location ID. Typically a 745 * return address up the stack. Optional (0). 746 * @param pszFile The file where the lock is being acquired from. 747 * Optional. 748 * @param iLine The line number in that file. Optional (0). 749 * @param pszFunction The functionn where the lock is being acquired 750 * from. Optional. 751 */ 752 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 753 754 /** 755 * Release read access to a read/write semaphore. 756 * 757 * @returns iprt status code. 758 * @param RWSem The Read/Write sempahore to release read access to. 759 * Goes without saying that caller must have read access to the sem. 760 */ 761 RTDECL(int) RTSemRWReleaseRead(RTSEMRW RWSem); 762 763 /** 764 * Request write access to a read/write semaphore, resume on interruption. 765 * 766 * @returns iprt status code. 767 * @retval VINF_SUCCESS on success. 768 * @retval VERR_DEADLOCK if the caller owned the read lock. 769 * @retval VERR_INVALID_HANDLE if RWSem is invalid. 770 * 771 * @param RWSem The Read/Write semaphore to request write access to. 772 * @param cMillies The number of milliseconds to wait. 773 */ 774 RTDECL(int) RTSemRWRequestWrite(RTSEMRW RWSem, unsigned cMillies); 775 776 /** 777 * Request write access to a read/write semaphore, return on interruption. 778 * 779 * @returns iprt status code. 780 * @retval VINF_SUCCESS on success. 781 * @retval VERR_INTERRUPT if the wait was interrupted. 782 * @retval VERR_DEADLOCK if the caller owned the read lock. 783 * @retval VERR_INVALID_HANDLE if RWSem is invalid. 784 * 785 * @param RWSem The Read/Write semaphore to request write access to. 786 * @param cMillies The number of milliseconds to wait. 787 */ 788 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW RWSem, unsigned cMillies); 789 790 /** 791 * Debug version of RTSemRWRequestWrite that tracks the location. 792 * 793 * @returns IPRT status code, see RTSemRWRequestWrite. 794 * @param RWSem The Read/Write semaphore to request write access 795 * to. 721 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 722 * 723 * @param hRWSem Handle to the read/write semaphore. 796 724 * @param cMillies The number of milliseconds to wait. 797 725 * @param uId Some kind of locking location ID. Typically a … … 803 731 * from. Optional. 804 732 */ 805 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL);733 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 806 734 807 735 /** 808 736 * Debug version of RTSemRWRequestWriteNoResume that tracks the location. 809 737 * 810 * @returns IPRT status code, see RTSemRWRequestWriteNoResume. 811 * @param RWSem The Read/Write semaphore to request write access 812 * to. 738 * @returns iprt status code. 739 * @retval VINF_SUCCESS on success. 740 * @retval VERR_INTERRUPT if the wait was interrupted. 741 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 742 * 743 * @param hRWSem Handle to the read/write semaphore. 813 744 * @param cMillies The number of milliseconds to wait. 814 745 * @param uId Some kind of locking location ID. Typically a … … 820 751 * from. Optional. 821 752 */ 822 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 753 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 754 755 /** 756 * Release read access to a read/write semaphore. 757 * 758 * @returns iprt status code. 759 * @param hRWSem Handle to the read/write semaphore. It goes 760 * without saying that caller must own read 761 * privileges to the semaphore. 762 */ 763 RTDECL(int) RTSemRWReleaseRead(RTSEMRW hRWSem); 764 765 /** 766 * Request write access to a read/write semaphore, resume on interruption. 767 * 768 * @returns iprt status code. 769 * @retval VINF_SUCCESS on success. 770 * @retval VERR_DEADLOCK if the caller owned the read lock. 771 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 772 * 773 * @param hRWSem Handle to the read/write semaphore. 774 * @param cMillies The number of milliseconds to wait. 775 */ 776 RTDECL(int) RTSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies); 777 778 /** 779 * Request write access to a read/write semaphore, return on interruption. 780 * 781 * @returns iprt status code. 782 * @retval VINF_SUCCESS on success. 783 * @retval VERR_INTERRUPT if the wait was interrupted. 784 * @retval VERR_DEADLOCK if the caller owned the read lock. 785 * @retval VERR_INVALID_HANDLE if hRWSem is invalid. 786 * 787 * @param hRWSem Handle to the read/write semaphore. 788 * @param cMillies The number of milliseconds to wait. 789 */ 790 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies); 791 792 /** 793 * Debug version of RTSemRWRequestWrite that tracks the location. 794 * 795 * @returns IPRT status code, see RTSemRWRequestWrite. 796 * @param hRWSem Handle to the read/write semaphore. 797 * @param cMillies The number of milliseconds to wait. 798 * @param uId Some kind of locking location ID. Typically a 799 * return address up the stack. Optional (0). 800 * @param pszFile The file where the lock is being acquired from. 801 * Optional. 802 * @param iLine The line number in that file. Optional (0). 803 * @param pszFunction The functionn where the lock is being acquired 804 * from. Optional. 805 */ 806 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 807 808 /** 809 * Debug version of RTSemRWRequestWriteNoResume that tracks the location. 810 * 811 * @returns IPRT status code, see RTSemRWRequestWriteNoResume. 812 * @param hRWSem Handle to the read/write semaphore. 813 * @param cMillies The number of milliseconds to wait. 814 * @param uId Some kind of locking location ID. Typically a 815 * return address up the stack. Optional (0). 816 * @param pszFile The file where the lock is being acquired from. 817 * Optional. 818 * @param iLine The line number in that file. Optional (0). 819 * @param pszFunction The functionn where the lock is being acquired 820 * from. Optional. 821 */ 822 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL); 823 823 824 824 /** … … 826 826 * 827 827 * @returns iprt status code. 828 * @param RWSem The Read/Write sempahore to release read access to. 829 * Goes without saying that caller must have write access to the sem. 830 */ 831 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW RWSem); 828 * @param hRWSem Handle to the read/write semaphore. Goes 829 * without saying that caller must have write 830 * access to the semaphore. 831 */ 832 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW hRWSem); 832 833 833 834 /** … … 835 836 * 836 837 * @returns true / false accoringly. 837 * @param RWSem The Read/Write semaphore in question.838 */ 839 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW RWSem);838 * @param hRWSem Handle to the read/write semaphore. 839 */ 840 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW hRWSem); 840 841 841 842 /** … … 843 844 * 844 845 * @returns The write recursion count (0 if bad semaphore handle). 845 * @param RWSem The Read/Write semaphore in question.846 */ 847 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW RWSem);846 * @param hRWSem Handle to the read/write semaphore. 847 */ 848 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW hRWSem); 848 849 849 850 /** … … 851 852 * 852 853 * @returns The read recursion count (0 if bad semaphore handle). 853 * @param RWSem The Read/Write semaphore in question.854 */ 855 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW RWSem);854 * @param hRWSem Handle to the read/write semaphore. 855 */ 856 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW hRWSem); 856 857 857 858 /** … … 862 863 * 863 864 * @returns The read count (0 if bad semaphore handle). 864 * @param RWSem The Read/Write semaphore in question.865 */ 866 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem);865 * @param hRWSem Handle to the read/write semaphore. 866 */ 867 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW hRWSem); 867 868 868 869 /* Strict build: Remap the four request calls to the debug versions. */ -
trunk/src/VBox/Runtime/generic/semrw-generic.cpp
r25711 r25723 170 170 171 171 172 RTDECL(int) RTSemRWDestroy(RTSEMRW RWSem)173 { 174 struct RTSEMRWINTERNAL *pThis = RWSem;172 RTDECL(int) RTSemRWDestroy(RTSEMRW hRWSem) 173 { 174 struct RTSEMRWINTERNAL *pThis = hRWSem; 175 175 176 176 /* … … 254 254 255 255 256 DECL_FORCE_INLINE(int) rtSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos)256 DECL_FORCE_INLINE(int) rtSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos) 257 257 { 258 258 /* 259 259 * Validate handle. 260 260 */ 261 struct RTSEMRWINTERNAL *pThis = RWSem;261 struct RTSEMRWINTERNAL *pThis = hRWSem; 262 262 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 263 263 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 288 288 if (RT_FAILURE(rc)) 289 289 { 290 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", RWSem, rc));290 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 291 291 return rc; 292 292 } … … 374 374 if (RT_FAILURE(rc) && rc != VERR_TIMEOUT) /* handle timeout below */ 375 375 { 376 AssertMsgRC(rc, ("RTSemEventMultiWait failed on rwsem %p, rc=%Rrc\n", RWSem, rc));376 AssertMsgRC(rc, ("RTSemEventMultiWait failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 377 377 break; 378 378 } … … 390 390 if (RT_FAILURE(rc)) 391 391 { 392 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", RWSem, rc));392 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 393 393 break; 394 394 } … … 429 429 430 430 #undef RTSemRWRequestRead 431 RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies)431 RTDECL(int) RTSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 432 432 { 433 433 #ifndef RTSEMRW_STRICT 434 return rtSemRWRequestRead( RWSem, cMillies, false, NULL);434 return rtSemRWRequestRead(hRWSem, cMillies, false, NULL); 435 435 #else 436 436 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 437 return rtSemRWRequestRead( RWSem, cMillies, false, &SrcPos);437 return rtSemRWRequestRead(hRWSem, cMillies, false, &SrcPos); 438 438 #endif 439 439 } … … 441 441 442 442 443 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)443 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 444 444 { 445 445 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 446 return rtSemRWRequestRead( RWSem, cMillies, false, &SrcPos);446 return rtSemRWRequestRead(hRWSem, cMillies, false, &SrcPos); 447 447 } 448 448 RT_EXPORT_SYMBOL(RTSemRWRequestReadDebug); … … 450 450 451 451 #undef RTSemRWRequestReadNoResume 452 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW RWSem, unsignedcMillies)452 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 453 453 { 454 454 #ifndef RTSEMRW_STRICT 455 return rtSemRWRequestRead( RWSem, cMillies, true, NULL);455 return rtSemRWRequestRead(hRWSem, cMillies, true, NULL); 456 456 #else 457 457 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 458 return rtSemRWRequestRead( RWSem, cMillies, true, &SrcPos);458 return rtSemRWRequestRead(hRWSem, cMillies, true, &SrcPos); 459 459 #endif 460 460 } … … 462 462 463 463 464 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)464 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 465 465 { 466 466 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 467 return rtSemRWRequestRead( RWSem, cMillies, true, &SrcPos);467 return rtSemRWRequestRead(hRWSem, cMillies, true, &SrcPos); 468 468 } 469 469 RT_EXPORT_SYMBOL(RTSemRWRequestReadNoResumeDebug); 470 470 471 471 472 RTDECL(int) RTSemRWReleaseRead(RTSEMRW RWSem)473 { 474 struct RTSEMRWINTERNAL *pThis = RWSem;472 RTDECL(int) RTSemRWReleaseRead(RTSEMRW hRWSem) 473 { 474 struct RTSEMRWINTERNAL *pThis = hRWSem; 475 475 476 476 /* … … 502 502 { 503 503 rc = RTSemEventSignal(pThis->WriteEvent); 504 AssertMsgRC(rc, ("Failed to signal writers on rwsem %p, rc=%Rrc\n", RWSem, rc));504 AssertMsgRC(rc, ("Failed to signal writers on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 505 505 } 506 506 } … … 543 543 } 544 544 else 545 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", RWSem, rc));545 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 546 546 547 547 return rc; … … 550 550 551 551 552 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsignedcMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos)552 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos) 553 553 { 554 554 /* 555 555 * Validate handle. 556 556 */ 557 struct RTSEMRWINTERNAL *pThis = RWSem;557 struct RTSEMRWINTERNAL *pThis = hRWSem; 558 558 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 559 559 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 581 581 if (RT_FAILURE(rc)) 582 582 { 583 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", RWSem, rc));583 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 584 584 return rc; 585 585 } … … 605 605 pThis->fNeedResetReadEvent = false; 606 606 rc = RTSemEventMultiReset(pThis->ReadEvent); 607 AssertMsgRC(rc, ("Failed to reset readers, rwsem %p, rc=%Rrc.\n", RWSem, rc));607 AssertMsgRC(rc, ("Failed to reset readers, rwsem %p, rc=%Rrc.\n", hRWSem, rc)); 608 608 } 609 609 … … 665 665 if (RT_UNLIKELY(RT_FAILURE_NP(rc) && rc != VERR_TIMEOUT)) /* timeouts are handled below */ 666 666 { 667 AssertMsgRC(rc, ("RTSemEventWait failed on rwsem %p, rc=%Rrc\n", RWSem, rc));667 AssertMsgRC(rc, ("RTSemEventWait failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 668 668 break; 669 669 } … … 681 681 if (RT_FAILURE(rc)) 682 682 { 683 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", RWSem, rc));683 AssertMsgFailed(("RTCritSectEnter failed on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 684 684 break; 685 685 } … … 694 694 pThis->fNeedResetReadEvent = false; 695 695 rc = RTSemEventMultiReset(pThis->ReadEvent); 696 AssertMsgRC(rc, ("Failed to reset readers, rwsem %p, rc=%Rrc.\n", RWSem, rc));696 AssertMsgRC(rc, ("Failed to reset readers, rwsem %p, rc=%Rrc.\n", hRWSem, rc)); 697 697 } 698 698 … … 735 735 736 736 #undef RTSemRWRequestWrite 737 RTDECL(int) RTSemRWRequestWrite(RTSEMRW RWSem, unsignedcMillies)737 RTDECL(int) RTSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 738 738 { 739 739 #ifndef RTSEMRW_STRICT 740 return rtSemRWRequestWrite( RWSem, cMillies, false, NULL);740 return rtSemRWRequestWrite(hRWSem, cMillies, false, NULL); 741 741 #else 742 742 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 743 return rtSemRWRequestWrite( RWSem, cMillies, false, &SrcPos);743 return rtSemRWRequestWrite(hRWSem, cMillies, false, &SrcPos); 744 744 #endif 745 745 } … … 747 747 748 748 749 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)749 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 750 750 { 751 751 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 752 return rtSemRWRequestWrite( RWSem, cMillies, false, &SrcPos);752 return rtSemRWRequestWrite(hRWSem, cMillies, false, &SrcPos); 753 753 } 754 754 RT_EXPORT_SYMBOL(RTSemRWRequestWriteDebug); … … 756 756 757 757 #undef RTSemRWRequestWriteNoResume 758 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW RWSem, unsignedcMillies)758 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 759 759 { 760 760 #ifndef RTSEMRW_STRICT 761 return rtSemRWRequestWrite( RWSem, cMillies, true, NULL);761 return rtSemRWRequestWrite(hRWSem, cMillies, true, NULL); 762 762 #else 763 763 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 764 return rtSemRWRequestWrite( RWSem, cMillies, true, &SrcPos);764 return rtSemRWRequestWrite(hRWSem, cMillies, true, &SrcPos); 765 765 #endif 766 766 } … … 768 768 769 769 770 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)770 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 771 771 { 772 772 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 773 return rtSemRWRequestWrite( RWSem, cMillies, true, &SrcPos);773 return rtSemRWRequestWrite(hRWSem, cMillies, true, &SrcPos); 774 774 } 775 775 RT_EXPORT_SYMBOL(RTSemRWRequestWriteNoResumeDebug); 776 776 777 777 778 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW RWSem)778 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW hRWSem) 779 779 { 780 780 … … 782 782 * Validate handle. 783 783 */ 784 struct RTSEMRWINTERNAL *pThis = RWSem;784 struct RTSEMRWINTERNAL *pThis = hRWSem; 785 785 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 786 786 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 799 799 { 800 800 RTCritSectLeave(&pThis->CritSect); 801 AssertMsgFailed(("Not read-write owner of rwsem %p.\n", RWSem));801 AssertMsgFailed(("Not read-write owner of rwsem %p.\n", hRWSem)); 802 802 return VERR_NOT_OWNER; 803 803 } … … 839 839 { 840 840 rc = RTSemEventMultiSignal(pThis->ReadEvent); 841 AssertMsgRC(rc, ("RTSemEventMultiSignal failed for rwsem %p, rc=%Rrc.\n", RWSem, rc));841 AssertMsgRC(rc, ("RTSemEventMultiSignal failed for rwsem %p, rc=%Rrc.\n", hRWSem, rc)); 842 842 pThis->fNeedResetReadEvent = true; 843 843 } … … 845 845 { 846 846 rc = RTSemEventSignal(pThis->WriteEvent); 847 AssertMsgRC(rc, ("Failed to signal writers on rwsem %p, rc=%Rrc\n", RWSem, rc));847 AssertMsgRC(rc, ("Failed to signal writers on rwsem %p, rc=%Rrc\n", hRWSem, rc)); 848 848 } 849 849 RTCritSectLeave(&pThis->CritSect); … … 854 854 855 855 856 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW RWSem)857 { 858 struct RTSEMRWINTERNAL *pThis = RWSem;856 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW hRWSem) 857 { 858 struct RTSEMRWINTERNAL *pThis = hRWSem; 859 859 860 860 /* … … 875 875 876 876 877 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW RWSem)878 { 879 struct RTSEMRWINTERNAL *pThis = RWSem;877 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW hRWSem) 878 { 879 struct RTSEMRWINTERNAL *pThis = hRWSem; 880 880 881 881 /* … … 893 893 894 894 895 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW RWSem)896 { 897 struct RTSEMRWINTERNAL *pThis = RWSem;895 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW hRWSem) 896 { 897 struct RTSEMRWINTERNAL *pThis = hRWSem; 898 898 899 899 /* … … 911 911 912 912 913 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)913 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW hRWSem) 914 914 { 915 915 /* 916 916 * Validate input. 917 917 */ 918 struct RTSEMRWINTERNAL *pThis = RWSem;918 struct RTSEMRWINTERNAL *pThis = hRWSem; 919 919 AssertPtrReturn(pThis, 0); 920 920 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, -
trunk/src/VBox/Runtime/generic/semrw-lockless-generic.cpp
r25710 r25723 222 222 223 223 224 static int rtSemRWRequestRead(RTSEMRW hRWSem, unsignedcMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos)224 static int rtSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos) 225 225 { 226 226 /* … … 418 418 419 419 #undef RTSemRWRequestRead 420 RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies)420 RTDECL(int) RTSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 421 421 { 422 422 #ifndef RTSEMRW_STRICT 423 return rtSemRWRequestRead( RWSem, cMillies, false, NULL);423 return rtSemRWRequestRead(hRWSem, cMillies, false, NULL); 424 424 #else 425 425 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 426 return rtSemRWRequestRead( RWSem, cMillies, false, &SrcPos);426 return rtSemRWRequestRead(hRWSem, cMillies, false, &SrcPos); 427 427 #endif 428 428 } … … 430 430 431 431 432 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)432 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 433 433 { 434 434 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 435 return rtSemRWRequestRead( RWSem, cMillies, false, &SrcPos);435 return rtSemRWRequestRead(hRWSem, cMillies, false, &SrcPos); 436 436 } 437 437 RT_EXPORT_SYMBOL(RTSemRWRequestReadDebug); … … 439 439 440 440 #undef RTSemRWRequestReadNoResume 441 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW RWSem, unsignedcMillies)441 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 442 442 { 443 443 #ifndef RTSEMRW_STRICT 444 return rtSemRWRequestRead( RWSem, cMillies, true, NULL);444 return rtSemRWRequestRead(hRWSem, cMillies, true, NULL); 445 445 #else 446 446 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 447 return rtSemRWRequestRead( RWSem, cMillies, true, &SrcPos);447 return rtSemRWRequestRead(hRWSem, cMillies, true, &SrcPos); 448 448 #endif 449 449 } … … 451 451 452 452 453 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)453 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 454 454 { 455 455 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 456 return rtSemRWRequestRead( RWSem, cMillies, true, &SrcPos);456 return rtSemRWRequestRead(hRWSem, cMillies, true, &SrcPos); 457 457 } 458 458 RT_EXPORT_SYMBOL(RTSemRWRequestReadNoResumeDebug); … … 460 460 461 461 462 RTDECL(int) RTSemRWReleaseRead(RTSEMRW RWSem)462 RTDECL(int) RTSemRWReleaseRead(RTSEMRW hRWSem) 463 463 { 464 464 /* 465 465 * Validate handle. 466 466 */ 467 RTSEMRWINTERNAL *pThis = RWSem;467 RTSEMRWINTERNAL *pThis = hRWSem; 468 468 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 469 469 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 534 534 535 535 536 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW hRWSem, unsignedcMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos)536 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies, bool fInterruptible, PCRTLOCKVALSRCPOS pSrcPos) 537 537 { 538 538 /* … … 709 709 710 710 #undef RTSemRWRequestWrite 711 RTDECL(int) RTSemRWRequestWrite(RTSEMRW RWSem, unsignedcMillies)711 RTDECL(int) RTSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 712 712 { 713 713 #ifndef RTSEMRW_STRICT 714 return rtSemRWRequestWrite( RWSem, cMillies, false, NULL);714 return rtSemRWRequestWrite(hRWSem, cMillies, false, NULL); 715 715 #else 716 716 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 717 return rtSemRWRequestWrite( RWSem, cMillies, false, &SrcPos);717 return rtSemRWRequestWrite(hRWSem, cMillies, false, &SrcPos); 718 718 #endif 719 719 } … … 721 721 722 722 723 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)723 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 724 724 { 725 725 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 726 return rtSemRWRequestWrite( RWSem, cMillies, false, &SrcPos);726 return rtSemRWRequestWrite(hRWSem, cMillies, false, &SrcPos); 727 727 } 728 728 RT_EXPORT_SYMBOL(RTSemRWRequestWriteDebug); … … 730 730 731 731 #undef RTSemRWRequestWriteNoResume 732 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW RWSem, unsignedcMillies)732 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 733 733 { 734 734 #ifndef RTSEMRW_STRICT 735 return rtSemRWRequestWrite( RWSem, cMillies, true, NULL);735 return rtSemRWRequestWrite(hRWSem, cMillies, true, NULL); 736 736 #else 737 737 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 738 return rtSemRWRequestWrite( RWSem, cMillies, true, &SrcPos);738 return rtSemRWRequestWrite(hRWSem, cMillies, true, &SrcPos); 739 739 #endif 740 740 } … … 742 742 743 743 744 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)744 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 745 745 { 746 746 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 747 return rtSemRWRequestWrite( RWSem, cMillies, true, &SrcPos);747 return rtSemRWRequestWrite(hRWSem, cMillies, true, &SrcPos); 748 748 } 749 749 RT_EXPORT_SYMBOL(RTSemRWRequestWriteNoResumeDebug); 750 750 751 751 752 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW RWSem)752 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW hRWSem) 753 753 { 754 754 … … 756 756 * Validate handle. 757 757 */ 758 struct RTSEMRWINTERNAL *pThis = RWSem;758 struct RTSEMRWINTERNAL *pThis = hRWSem; 759 759 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 760 760 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 844 844 845 845 846 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW RWSem)846 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW hRWSem) 847 847 { 848 848 /* 849 849 * Validate handle. 850 850 */ 851 struct RTSEMRWINTERNAL *pThis = RWSem;851 struct RTSEMRWINTERNAL *pThis = hRWSem; 852 852 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 853 853 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 864 864 865 865 866 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW RWSem)866 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW hRWSem) 867 867 { 868 868 /* 869 869 * Validate handle. 870 870 */ 871 struct RTSEMRWINTERNAL *pThis = RWSem;871 struct RTSEMRWINTERNAL *pThis = hRWSem; 872 872 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 873 873 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 881 881 882 882 883 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW RWSem)883 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW hRWSem) 884 884 { 885 885 /* 886 886 * Validate handle. 887 887 */ 888 struct RTSEMRWINTERNAL *pThis = RWSem;888 struct RTSEMRWINTERNAL *pThis = hRWSem; 889 889 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 890 890 AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE); … … 898 898 899 899 900 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)900 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW hRWSem) 901 901 { 902 902 /* 903 903 * Validate input. 904 904 */ 905 struct RTSEMRWINTERNAL *pThis = RWSem;905 struct RTSEMRWINTERNAL *pThis = hRWSem; 906 906 AssertPtrReturn(pThis, 0); 907 907 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, -
trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
r25710 r25723 155 155 156 156 157 RTDECL(int) RTSemRWDestroy(RTSEMRW RWSem)157 RTDECL(int) RTSemRWDestroy(RTSEMRW hRWSem) 158 158 { 159 159 /* 160 160 * Validate input, nil handle is fine. 161 161 */ 162 struct RTSEMRWINTERNAL *pThis = RWSem;162 struct RTSEMRWINTERNAL *pThis = hRWSem; 163 163 if (pThis == NIL_RTSEMRW) 164 164 return VINF_SUCCESS; … … 189 189 { 190 190 ASMAtomicWriteU32(&pThis->u32Magic, RTSEMRW_MAGIC); 191 AssertMsgFailed(("Failed to destroy read-write sem %p, rc=%d.\n", RWSem, rc));191 AssertMsgFailed(("Failed to destroy read-write sem %p, rc=%d.\n", hRWSem, rc)); 192 192 rc = RTErrConvertFromErrno(rc); 193 193 } … … 215 215 216 216 217 DECL_FORCE_INLINE(int) rtSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies, PCRTLOCKVALSRCPOS pSrcPos)218 { 219 /* 220 * Validate input. 221 */ 222 struct RTSEMRWINTERNAL *pThis = RWSem;217 DECL_FORCE_INLINE(int) rtSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies, PCRTLOCKVALSRCPOS pSrcPos) 218 { 219 /* 220 * Validate input. 221 */ 222 struct RTSEMRWINTERNAL *pThis = hRWSem; 223 223 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 224 224 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 269 269 if (rc) 270 270 { 271 AssertMsgFailed(("Failed read lock read-write sem %p, rc=%d.\n", RWSem, rc));271 AssertMsgFailed(("Failed read lock read-write sem %p, rc=%d.\n", hRWSem, rc)); 272 272 return RTErrConvertFromErrno(rc); 273 273 } … … 301 301 if (rc) 302 302 { 303 AssertMsg(rc == ETIMEDOUT, ("Failed read lock read-write sem %p, rc=%d.\n", RWSem, rc));303 AssertMsg(rc == ETIMEDOUT, ("Failed read lock read-write sem %p, rc=%d.\n", hRWSem, rc)); 304 304 return RTErrConvertFromErrno(rc); 305 305 } … … 316 316 317 317 #undef RTSemRWRequestRead 318 RTDECL(int) RTSemRWRequestRead(RTSEMRW RWSem, unsignedcMillies)318 RTDECL(int) RTSemRWRequestRead(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 319 319 { 320 320 #ifndef RTSEMRW_STRICT 321 return rtSemRWRequestRead( RWSem, cMillies, NULL);321 return rtSemRWRequestRead(hRWSem, cMillies, NULL); 322 322 #else 323 323 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 324 return rtSemRWRequestRead( RWSem, cMillies, &SrcPos);325 #endif 326 } 327 328 329 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)324 return rtSemRWRequestRead(hRWSem, cMillies, &SrcPos); 325 #endif 326 } 327 328 329 RTDECL(int) RTSemRWRequestReadDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 330 330 { 331 331 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 332 return rtSemRWRequestRead( RWSem, cMillies, &SrcPos);332 return rtSemRWRequestRead(hRWSem, cMillies, &SrcPos); 333 333 } 334 334 335 335 336 336 #undef RTSemRWRequestReadNoResume 337 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW RWSem, unsignedcMillies)337 RTDECL(int) RTSemRWRequestReadNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 338 338 { 339 339 /* EINTR isn't returned by the wait functions we're using. */ 340 340 #ifndef RTSEMRW_STRICT 341 return rtSemRWRequestRead( RWSem, cMillies, NULL);341 return rtSemRWRequestRead(hRWSem, cMillies, NULL); 342 342 #else 343 343 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 344 return rtSemRWRequestRead( RWSem, cMillies, &SrcPos);345 #endif 346 } 347 348 349 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)344 return rtSemRWRequestRead(hRWSem, cMillies, &SrcPos); 345 #endif 346 } 347 348 349 RTDECL(int) RTSemRWRequestReadNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 350 350 { 351 351 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 352 return rtSemRWRequestRead( RWSem, cMillies, &SrcPos);353 } 354 355 356 RTDECL(int) RTSemRWReleaseRead(RTSEMRW RWSem)357 { 358 /* 359 * Validate input. 360 */ 361 struct RTSEMRWINTERNAL *pThis = RWSem;352 return rtSemRWRequestRead(hRWSem, cMillies, &SrcPos); 353 } 354 355 356 RTDECL(int) RTSemRWReleaseRead(RTSEMRW hRWSem) 357 { 358 /* 359 * Validate input. 360 */ 361 struct RTSEMRWINTERNAL *pThis = hRWSem; 362 362 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 363 363 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 403 403 { 404 404 ASMAtomicIncU32(&pThis->cReaders); 405 AssertMsgFailed(("Failed read unlock read-write sem %p, rc=%d.\n", RWSem, rc));405 AssertMsgFailed(("Failed read unlock read-write sem %p, rc=%d.\n", hRWSem, rc)); 406 406 return RTErrConvertFromErrno(rc); 407 407 } … … 410 410 411 411 412 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsignedcMillies, PCRTLOCKVALSRCPOS pSrcPos)413 { 414 /* 415 * Validate input. 416 */ 417 struct RTSEMRWINTERNAL *pThis = RWSem;412 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies, PCRTLOCKVALSRCPOS pSrcPos) 413 { 414 /* 415 * Validate input. 416 */ 417 struct RTSEMRWINTERNAL *pThis = hRWSem; 418 418 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 419 419 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 464 464 if (rc) 465 465 { 466 AssertMsgFailed(("Failed write lock read-write sem %p, rc=%d.\n", RWSem, rc));466 AssertMsgFailed(("Failed write lock read-write sem %p, rc=%d.\n", hRWSem, rc)); 467 467 return RTErrConvertFromErrno(rc); 468 468 } … … 495 495 if (rc) 496 496 { 497 AssertMsg(rc == ETIMEDOUT, ("Failed read lock read-write sem %p, rc=%d.\n", RWSem, rc));497 AssertMsg(rc == ETIMEDOUT, ("Failed read lock read-write sem %p, rc=%d.\n", hRWSem, rc)); 498 498 return RTErrConvertFromErrno(rc); 499 499 } … … 512 512 513 513 #undef RTSemRWRequestWrite 514 RTDECL(int) RTSemRWRequestWrite(RTSEMRW RWSem, unsignedcMillies)514 RTDECL(int) RTSemRWRequestWrite(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 515 515 { 516 516 #ifndef RTSEMRW_STRICT 517 return rtSemRWRequestWrite( RWSem, cMillies, NULL);517 return rtSemRWRequestWrite(hRWSem, cMillies, NULL); 518 518 #else 519 519 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 520 return rtSemRWRequestWrite( RWSem, cMillies, &SrcPos);521 #endif 522 } 523 524 525 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)520 return rtSemRWRequestWrite(hRWSem, cMillies, &SrcPos); 521 #endif 522 } 523 524 525 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 526 526 { 527 527 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 528 return rtSemRWRequestWrite( RWSem, cMillies, &SrcPos);528 return rtSemRWRequestWrite(hRWSem, cMillies, &SrcPos); 529 529 } 530 530 531 531 532 532 #undef RTSemRWRequestWriteNoResume 533 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW RWSem, unsignedcMillies)533 RTDECL(int) RTSemRWRequestWriteNoResume(RTSEMRW hRWSem, RTMSINTERVAL cMillies) 534 534 { 535 535 /* EINTR isn't returned by the wait functions we're using. */ 536 536 #ifndef RTSEMRW_STRICT 537 return rtSemRWRequestWrite( RWSem, cMillies, NULL);537 return rtSemRWRequestWrite(hRWSem, cMillies, NULL); 538 538 #else 539 539 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 540 return rtSemRWRequestWrite( RWSem, cMillies, &SrcPos);541 #endif 542 } 543 544 545 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW RWSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)540 return rtSemRWRequestWrite(hRWSem, cMillies, &SrcPos); 541 #endif 542 } 543 544 545 RTDECL(int) RTSemRWRequestWriteNoResumeDebug(RTSEMRW hRWSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 546 546 { 547 547 /* EINTR isn't returned by the wait functions we're using. */ 548 548 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 549 return rtSemRWRequestWrite( RWSem, cMillies, &SrcPos);550 } 551 552 553 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW RWSem)554 { 555 /* 556 * Validate input. 557 */ 558 struct RTSEMRWINTERNAL *pThis = RWSem;549 return rtSemRWRequestWrite(hRWSem, cMillies, &SrcPos); 550 } 551 552 553 RTDECL(int) RTSemRWReleaseWrite(RTSEMRW hRWSem) 554 { 555 /* 556 * Validate input. 557 */ 558 struct RTSEMRWINTERNAL *pThis = hRWSem; 559 559 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 560 560 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 596 596 if (rc) 597 597 { 598 AssertMsgFailed(("Failed write unlock read-write sem %p, rc=%d.\n", RWSem, rc));598 AssertMsgFailed(("Failed write unlock read-write sem %p, rc=%d.\n", hRWSem, rc)); 599 599 return RTErrConvertFromErrno(rc); 600 600 } … … 604 604 605 605 606 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW RWSem)607 { 608 /* 609 * Validate input. 610 */ 611 struct RTSEMRWINTERNAL *pThis = RWSem;606 RTDECL(bool) RTSemRWIsWriteOwner(RTSEMRW hRWSem) 607 { 608 /* 609 * Validate input. 610 */ 611 struct RTSEMRWINTERNAL *pThis = hRWSem; 612 612 AssertPtrReturn(pThis, false); 613 613 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 625 625 626 626 627 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW RWSem)628 { 629 /* 630 * Validate input. 631 */ 632 struct RTSEMRWINTERNAL *pThis = RWSem;627 RTDECL(uint32_t) RTSemRWGetWriteRecursion(RTSEMRW hRWSem) 628 { 629 /* 630 * Validate input. 631 */ 632 struct RTSEMRWINTERNAL *pThis = hRWSem; 633 633 AssertPtrReturn(pThis, 0); 634 634 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 643 643 644 644 645 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW RWSem)646 { 647 /* 648 * Validate input. 649 */ 650 struct RTSEMRWINTERNAL *pThis = RWSem;645 RTDECL(uint32_t) RTSemRWGetWriterReadRecursion(RTSEMRW hRWSem) 646 { 647 /* 648 * Validate input. 649 */ 650 struct RTSEMRWINTERNAL *pThis = hRWSem; 651 651 AssertPtrReturn(pThis, 0); 652 652 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC, … … 661 661 662 662 663 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW RWSem)664 { 665 /* 666 * Validate input. 667 */ 668 struct RTSEMRWINTERNAL *pThis = RWSem;663 RTDECL(uint32_t) RTSemRWGetReadCount(RTSEMRW hRWSem) 664 { 665 /* 666 * Validate input. 667 */ 668 struct RTSEMRWINTERNAL *pThis = hRWSem; 669 669 AssertPtrReturn(pThis, 0); 670 670 AssertMsgReturn(pThis->u32Magic == RTSEMRW_MAGIC,
Note:
See TracChangeset
for help on using the changeset viewer.