- Timestamp:
- Aug 4, 2011 2:05:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r37714 r38314 820 820 void *pvBuff; 821 821 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 822 #ifdef CHROMIUM_THREADSAFE 823 crLockMutex(&g_crvboxhgcm.mutex); 824 #endif 822 825 pvBuff = _crVBoxHGCMAlloc(conn); 826 #ifdef CHROMIUM_THREADSAFE 827 crUnlockMutex(&g_crvboxhgcm.mutex); 828 #endif 823 829 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 824 830 return pvBuff; … … 877 883 { 878 884 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 885 #ifdef CHROMIUM_THREADSAFE 886 crLockMutex(&g_crvboxhgcm.mutex); 887 #endif 879 888 _crVBoxHGCMWriteExact(conn, buf, len); 889 #ifdef CHROMIUM_THREADSAFE 890 crUnlockMutex(&g_crvboxhgcm.mutex); 891 #endif 880 892 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 881 893 } … … 1068 1080 CRVBOXHGCMBUFFER *hgcm_buffer; 1069 1081 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1082 1083 #ifdef CHROMIUM_THREADSAFE 1084 crLockMutex(&g_crvboxhgcm.mutex); 1085 #endif 1070 1086 1071 1087 if (!bufp) /* We're sending a user-allocated buffer. */ … … 1080 1096 crVBoxHGCMWriteReadExact(conn, start, len, CR_VBOXHGCM_USERALLOCATED); 1081 1097 #endif 1098 #ifdef CHROMIUM_THREADSAFE 1099 crUnlockMutex(&g_crvboxhgcm.mutex); 1100 #endif 1082 1101 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1083 1102 return; … … 1119 1138 *bufp = NULL; 1120 1139 1140 #ifdef CHROMIUM_THREADSAFE 1141 crUnlockMutex(&g_crvboxhgcm.mutex); 1142 #endif 1143 1121 1144 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1122 1145 } … … 1159 1182 { 1160 1183 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1184 #ifdef CHROMIUM_THREADSAFE 1185 crLockMutex(&g_crvboxhgcm.mutex); 1186 #endif 1161 1187 crVBoxHGCMReadExact(conn, buf, len); 1188 #ifdef CHROMIUM_THREADSAFE 1189 crUnlockMutex(&g_crvboxhgcm.mutex); 1190 #endif 1162 1191 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1163 1192 } … … 1205 1234 { 1206 1235 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1236 #ifdef CHROMIUM_THREADSAFE 1237 crLockMutex(&g_crvboxhgcm.mutex); 1238 #endif 1207 1239 _crVBoxHGCMFree(conn, buf); 1240 #ifdef CHROMIUM_THREADSAFE 1241 crUnlockMutex(&g_crvboxhgcm.mutex); 1242 #endif 1208 1243 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1209 1244 } … … 1290 1325 { 1291 1326 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1327 #ifdef CHROMIUM_THREADSAFE 1328 crLockMutex(&g_crvboxhgcm.mutex); 1329 #endif 1292 1330 _crVBoxHGCMReceiveMessage(conn); 1331 #ifdef CHROMIUM_THREADSAFE 1332 crUnlockMutex(&g_crvboxhgcm.mutex); 1333 #endif 1293 1334 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1294 1335 } … … 1592 1633 { 1593 1634 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1635 #ifdef CHROMIUM_THREADSAFE 1636 crLockMutex(&g_crvboxhgcm.mutex); 1637 #endif 1594 1638 _crVBoxHGCMFree(conn, mess); 1595 1639 CRASSERT(FALSE); 1640 #ifdef CHROMIUM_THREADSAFE 1641 crUnlockMutex(&g_crvboxhgcm.mutex); 1642 #endif 1596 1643 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1597 1644 } … … 1701 1748 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1702 1749 1750 #ifdef CHROMIUM_THREADSAFE 1751 crLockMutex(&g_crvboxhgcm.mutex); 1752 #endif 1753 1703 1754 pClient = _crVBoxHGSMIClientGet(conn); 1704 1755 if (pClient) … … 1712 1763 } 1713 1764 1765 #ifdef CHROMIUM_THREADSAFE 1766 crUnlockMutex(&g_crvboxhgcm.mutex); 1767 #endif 1768 1714 1769 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1715 1770 … … 1720 1775 { 1721 1776 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1777 #ifdef CHROMIUM_THREADSAFE 1778 crLockMutex(&g_crvboxhgcm.mutex); 1779 #endif 1722 1780 _crVBoxHGSMIFree(conn, buf); 1781 #ifdef CHROMIUM_THREADSAFE 1782 crUnlockMutex(&g_crvboxhgcm.mutex); 1783 #endif 1723 1784 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 1724 1785 } … … 2077 2138 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 2078 2139 2140 #ifdef CHROMIUM_THREADSAFE 2141 crLockMutex(&g_crvboxhgcm.mutex); 2142 #endif 2143 2079 2144 if (!bufp) /* We're sending a user-allocated buffer. */ 2080 2145 { … … 2091 2156 _crVBoxHGSMIWriteReadExact(conn, pClient, (void*)start, 0, len, false); 2092 2157 #endif 2158 #ifdef CHROMIUM_THREADSAFE 2159 crUnlockMutex(&g_crvboxhgcm.mutex); 2160 #endif 2093 2161 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2094 2162 return; … … 2097 2165 /* fallback */ 2098 2166 crVBoxHGCMSend(conn, bufp, start, len); 2167 #ifdef CHROMIUM_THREADSAFE 2168 crUnlockMutex(&g_crvboxhgcm.mutex); 2169 #endif 2099 2170 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2100 2171 return; … … 2113 2184 /* fallback */ 2114 2185 crVBoxHGCMSend(conn, bufp, start, len); 2186 #ifdef CHROMIUM_THREADSAFE 2187 crUnlockMutex(&g_crvboxhgcm.mutex); 2188 #endif 2115 2189 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2116 2190 return; … … 2127 2201 { 2128 2202 crVBoxHGCMSend(conn, bufp, start, len); 2203 #ifdef CHROMIUM_THREADSAFE 2204 crUnlockMutex(&g_crvboxhgcm.mutex); 2205 #endif 2129 2206 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2130 2207 return; … … 2159 2236 *bufp = NULL; 2160 2237 2238 #ifdef CHROMIUM_THREADSAFE 2239 crUnlockMutex(&g_crvboxhgcm.mutex); 2240 #endif 2241 2161 2242 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2162 2243 } … … 2167 2248 2168 2249 CRASSERT(0); 2169 // PCRVBOXHGSMI_CLIENT pClient; 2170 // PVBOXUHGSMI_BUFFER pBuf = _crVBoxHGSMIBufFromMemPtr(buf); 2171 // if (!pBuf) 2172 // return; 2173 // pClient = (PCRVBOXHGSMI_CLIENT)pBuf->pvUserData; 2174 // _crVBoxHGSMIWriteExact(conn, pClient, pBuf, 0, len); 2175 // _crVBoxHGSMIBufFree(pClient, pBuf); 2250 2176 2251 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2177 2252 } … … 2179 2254 static void crVBoxHGSMISingleRecv(CRConnection *conn, void *buf, unsigned int len) 2180 2255 { 2181 // PCRVBOXHGSMI_CLIENT pClient;2182 // PVBOXUHGSMI_BUFFER pBuf;2183 2256 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 2184 // pBuf = _crVBoxHGSMIBufFromMemPtr(buf); 2185 // Assert(pBuf); 2257 2186 2258 CRASSERT(0); 2187 // if (!pBuf) 2188 // { 2189 // VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2190 // return; 2191 // } 2192 // pClient = (PCRVBOXHGSMI_CLIENT)pBuf->pvUserData; 2193 // _crVBoxHGSMIReadExact(conn, pClient); 2259 2194 2260 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2195 2261 } … … 2199 2265 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 2200 2266 2267 #ifdef CHROMIUM_THREADSAFE 2268 crLockMutex(&g_crvboxhgcm.mutex); 2269 #endif 2270 2201 2271 CRASSERT(0); 2202 2272 2203 2273 _crVBoxHGCMReceiveMessage(conn); 2274 2275 #ifdef CHROMIUM_THREADSAFE 2276 crUnlockMutex(&g_crvboxhgcm.mutex); 2277 #endif 2278 2204 2279 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2205 2280 } … … 2227 2302 static void crVBoxHGSMIDoDisconnect( CRConnection *conn ) 2228 2303 { 2304 #ifdef CHROMIUM_THREADSAFE 2305 crLockMutex(&g_crvboxhgcm.mutex); 2306 #endif 2229 2307 #ifndef VBOX_CRHGSMI_WITH_D3DDEV 2230 2308 if (conn->HgsmiClient.pHgsmi) … … 2235 2313 VBoxCrHgsmiDestroy(pHgsmi); 2236 2314 } 2237 2238 2315 #endif 2239 2316 crVBoxHGCMDoDisconnect(conn); 2317 #ifdef CHROMIUM_THREADSAFE 2318 crUnlockMutex(&g_crvboxhgcm.mutex); 2319 #endif 2240 2320 } 2241 2321 … … 2243 2323 { 2244 2324 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 2325 #ifdef CHROMIUM_THREADSAFE 2326 crLockMutex(&g_crvboxhgcm.mutex); 2327 #endif 2245 2328 CRASSERT(0); 2246 2329 2247 2330 _crVBoxHGSMIFree(conn, mess); 2248 CRASSERT(FALSE); 2249 2331 2332 #ifdef CHROMIUM_THREADSAFE 2333 crUnlockMutex(&g_crvboxhgcm.mutex); 2334 #endif 2250 2335 VBOXCRHGSMIPROFILE_FUNC_EPILOGUE(); 2251 2336 }
Note:
See TracChangeset
for help on using the changeset viewer.