Changeset 25685 in vbox for trunk/include
- Timestamp:
- Jan 7, 2010 10:03:06 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56405
- Location:
- trunk/include/iprt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/critsect.h
r25645 r25685 102 102 /** If set, nesting(/recursion) is not allowed. */ 103 103 #define RTCRITSECT_FLAGS_NO_NESTING UINT32_C(0x00000001) 104 /** Disables lock validation. */ 105 #define RTCRITSECT_FLAGS_NO_LOCK_VAL UINT32_C(0x00000002) 104 106 105 107 #ifdef IN_RING3 … … 114 116 * 115 117 * @returns iprt status code. 116 * @param pCritSect Pointer to the critical section structure. 117 * @param fFlags Flags, any combination of the RTCRITSECT_FLAGS \#defines. 118 */ 119 RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags); 118 * @param pCritSect Pointer to the critical section structure. 119 * @param fFlags Flags, any combination of the RTCRITSECT_FLAGS 120 * \#defines. 121 * @param hClass The class (no reference consumed). If NIL, the 122 * no lock order validation will be performed on 123 * this lock. 124 * @param uSubClass The sub-class. This is used to define lock 125 * order inside the same class. If you don't know, 126 * then pass RTLOCKVAL_SUB_CLASS_NONE. 127 * @param pszName The lock name (optional). 128 */ 129 RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags, 130 RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszName); 120 131 121 132 /** … … 125 136 * @returns VERR_SEM_NESTED if nested enter on a no nesting section. (Asserted.) 126 137 * @returns VERR_SEM_DESTROYED if RTCritSectDelete was called while waiting. 127 * @param pCritSect The critical section.138 * @param pCritSect The critical section. 128 139 */ 129 140 RTDECL(int) RTCritSectEnter(PRTCRITSECT pCritSect); -
trunk/include/iprt/lockvalidator.h
r25682 r25685 241 241 242 242 243 /** @name Special sub-class values.244 * The range 16..UINT32_MAX is available to the user, the range 0..15 is245 * reserved for the lock validator.246 * @{ */247 /** Not allowed to be taken with any other locks in the same class.248 * This is the recommended value. */249 #define RTLOCKVAL_SUB_CLASS_NONE UINT32_C(0)250 /** Any order is allowed within the class. */251 #define RTLOCKVAL_SUB_CLASS_ANY UINT32_C(1)252 /** The first user value. */253 #define RTLOCKVAL_SUB_CLASS_USER UINT32_C(16)254 /** @} */255 256 243 /** 257 244 * Makes the two records siblings. … … 278 265 * @param pszName The lock name (optional). 279 266 * @param hLock The lock handle. 280 */ 281 RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, 282 uint32_t uSubClass, const char *pszName, void *hLock); 267 * @param fEnabled Pass @c false to explicitly disable lock 268 * validation, otherwise @c true. 269 */ 270 RTDECL(void) RTLockValidatorRecExclInit(PRTLOCKVALRECEXCL pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass, 271 const char *pszName, void *hLock, bool fEnabled); 283 272 /** 284 273 * Uninitialize a lock validator record previously initialized by … … 305 294 * @param pszName The lock name (optional). 306 295 * @param hLock The lock handle. 307 */ 308 RTDECL(int) RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass, 309 uint32_t uSubClass, const char *pszName, void *hLock); 296 * @param fEnabled Pass @c false to explicitly disable lock 297 * validation, otherwise @c true. 298 */ 299 RTDECL(int) RTLockValidatorRecExclCreate(PRTLOCKVALRECEXCL *ppRec, RTLOCKVALCLASS hClass, uint32_t uSubClass, 300 const char *pszName, void *hLock, bool fEnabled); 310 301 311 302 /** … … 441 432 * pass NIL_RTTHREAD and we'll figure it out. 442 433 * @param pSrcPos The source position of the lock operation. 443 */ 444 RTDECL(int) RTLockValidatorRecExclCheckOrder(PRTLOCKVALRECEXCL pRec, RTTHREAD hThreadSelf, PCRTLOCKVALSRCPOS pSrcPos); 434 * @param cMillies The timeout, in milliseconds. 435 */ 436 RTDECL(int) RTLockValidatorRecExclCheckOrder(PRTLOCKVALRECEXCL pRec, RTTHREAD hThreadSelf, 437 PCRTLOCKVALSRCPOS pSrcPos, RTMSINTERVAL cMillies); 445 438 446 439 /** … … 462 455 * @param pSrcPos The source position of the lock operation. 463 456 * @param fRecursiveOk Whether it's ok to recurse. 457 * @param cMillies The timeout, in milliseconds. 464 458 * @param enmSleepState The sleep state to enter on successful return. 465 459 * @param fReallySleeping Is it really going to sleep now or not. Use … … 468 462 */ 469 463 RTDECL(int) RTLockValidatorRecExclCheckBlocking(PRTLOCKVALRECEXCL pRec, RTTHREAD hThreadSelf, 470 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, 464 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, RTMSINTERVAL cMillies, 471 465 RTTHREADSTATE enmSleepState, bool fReallySleeping); 472 466 … … 480 474 * @param pSrcPos The source position of the lock operation. 481 475 * @param fRecursiveOk Whether it's ok to recurse. 476 * @param cMillies The timeout, in milliseconds. 482 477 * @param enmSleepState The sleep state to enter on successful return. 483 478 * @param fReallySleeping Is it really going to sleep now or not. Use … … 486 481 */ 487 482 RTDECL(int) RTLockValidatorRecExclCheckOrderAndBlocking(PRTLOCKVALRECEXCL pRec, RTTHREAD hThreadSelf, 488 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, 483 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, RTMSINTERVAL cMillies, 489 484 RTTHREADSTATE enmSleepState, bool fReallySleeping); 490 485 … … 506 501 * applied to this record, clear if read-write 507 502 * semaphore logic should be used. 503 * @param fEnabled Pass @c false to explicitly disable lock 504 * validation, otherwise @c true. 508 505 */ 509 506 RTDECL(void) RTLockValidatorRecSharedInit(PRTLOCKVALRECSHRD pRec, RTLOCKVALCLASS hClass, uint32_t uSubClass, 510 const char *pszName, void *hLock, bool fSignaller );507 const char *pszName, void *hLock, bool fSignaller, bool fEnabled); 511 508 /** 512 509 * Uninitialize a lock validator record previously initialized by … … 532 529 * @param pSrcPos The source position of the lock operation. 533 530 */ 534 RTDECL(int) RTLockValidatorRecSharedCheckOrder(PRTLOCKVALRECSHRD pRec, RTTHREAD hThreadSelf, PCRTLOCKVALSRCPOS pSrcPos); 531 RTDECL(int) RTLockValidatorRecSharedCheckOrder(PRTLOCKVALRECSHRD pRec, RTTHREAD hThreadSelf, 532 PCRTLOCKVALSRCPOS pSrcPos, RTMSINTERVAL cMillies); 535 533 536 534 /** … … 558 556 */ 559 557 RTDECL(int) RTLockValidatorRecSharedCheckBlocking(PRTLOCKVALRECSHRD pRec, RTTHREAD hThreadSelf, 560 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, 558 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, RTMSINTERVAL cMillies, 561 559 RTTHREADSTATE enmSleepState, bool fReallySleeping); 562 560 … … 576 574 */ 577 575 RTDECL(int) RTLockValidatorRecSharedCheckOrderAndBlocking(PRTLOCKVALRECSHRD pRec, RTTHREAD hThreadSelf, 578 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, 576 PCRTLOCKVALSRCPOS pSrcPos, bool fRecursiveOk, RTMSINTERVAL cMillies, 579 577 RTTHREADSTATE enmSleepState, bool fReallySleeping); 580 578 … … 731 729 * itself new locking order rules (true), or if the 732 730 * user will teach it all it needs to know (false). 731 * @param fRecursionOk Whether to allow lock recursion or not. 733 732 * @param cMsMinDeadlock Used to raise the sleep interval at which 734 733 * deadlock detection kicks in. Minimum is 1 ms, … … 737 736 * order validation kicks in. Minimum is 1 ms, 738 737 * while RT_INDEFINITE_WAIT will disable it. 738 * 739 * @remarks The properties can be modified after creation by the 740 * RTLockValidatorClassSet* methods. 739 741 */ 740 742 RTDECL(int) RTLockValidatorClassCreateEx(PRTLOCKVALCLASS phClass, PCRTLOCKVALSRCPOS pSrcPos, 741 bool fAutodidact, RTMSINTERVAL cMsMinDeadlock, RTMSINTERVAL cMsMinOrder); 743 bool fAutodidact, bool fRecursionOk, 744 RTMSINTERVAL cMsMinDeadlock, RTMSINTERVAL cMsMinOrder); 742 745 743 746 /** -
trunk/include/iprt/types.h
r25682 r25685 1495 1495 typedef struct RTLOCKVALSRCPOS const *PCRTLOCKVALSRCPOS; 1496 1496 1497 /** @name Special sub-class values. 1498 * The range 16..UINT32_MAX is available to the user, the range 0..15 is 1499 * reserved for the lock validator. 1500 * @{ */ 1501 /** Not allowed to be taken with any other locks in the same class. 1502 * This is the recommended value. */ 1503 #define RTLOCKVAL_SUB_CLASS_NONE UINT32_C(0) 1504 /** Any order is allowed within the class. */ 1505 #define RTLOCKVAL_SUB_CLASS_ANY UINT32_C(1) 1506 /** The first user value. */ 1507 #define RTLOCKVAL_SUB_CLASS_USER UINT32_C(16) 1508 /** @} */ 1509 1497 1510 1498 1511 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.