Changeset 47115 in vbox
- Timestamp:
- Jul 12, 2013 12:27:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
r44528 r47115 65 65 { 66 66 int rc; 67 uint32_t cNewUsers; 67 68 Assert(fReserved == 0); 68 69 RT_ASSERT_PREEMPTIBLE(); … … 73 74 * initialization races should two modules share the IPRT. 74 75 */ 75 if (ASMAtomicIncS32(&g_crtR0Users) != 1) 76 return VINF_SUCCESS; 76 cNewUsers = ASMAtomicIncS32(&g_crtR0Users); 77 if (cNewUsers != 1) 78 { 79 if (cNewUsers > 1) 80 return VINF_SUCCESS; 81 ASMAtomicDecS32(&g_crtR0Users); 82 return VERR_INTERNAL_ERROR_3; 83 } 77 84 78 85 rc = rtR0InitNative(); … … 127 134 if (cNewUsers == 0) 128 135 rtR0Term(); 136 else if (cNewUsers < 0) 137 ASMAtomicIncS32(&g_crtR0Users); 129 138 } 130 139 RT_EXPORT_SYMBOL(RTR0Term); … … 135 144 { 136 145 RT_ASSERT_PREEMPTIBLE(); 146 137 147 AssertMsg(g_crtR0Users == 1, ("%d\n", g_crtR0Users)); 148 ASMAtomicWriteS32(&g_crtR0Users, 0); 138 149 139 150 rtR0Term();
Note:
See TracChangeset
for help on using the changeset viewer.