Changeset 78341 in vbox for trunk/src/VBox/GuestHost/OpenGL/util/net.c
- Timestamp:
- Apr 28, 2019 4:47:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/net.c
r78190 r78341 48 48 int num_clients; /* total number of clients (unused?) */ 49 49 50 #ifdef CHROMIUM_THREADSAFE51 50 CRmutex mutex; 52 #endif53 51 } cr_net; 54 52 … … 134 132 { 135 133 crDebug("crNetConnectToServer() failed, freeing the connection"); 136 #ifdef CHROMIUM_THREADSAFE 137 crFreeMutex( &conn->messageList.lock ); 138 #endif 134 crFreeMutex( &conn->messageList.lock ); 139 135 conn->Disconnect(conn); 140 136 crFree( conn ); … … 219 215 { 220 216 conn->Disconnect(conn); 221 #ifdef CHROMIUM_THREADSAFE 222 crFreeMutex( &conn->messageList.lock ); 223 #endif 217 crFreeMutex( &conn->messageList.lock ); 224 218 crFree(conn); 225 219 } … … 244 238 cr_net.use_hgcm = 0; 245 239 cr_net.num_clients = 0; 246 #ifdef CHROMIUM_THREADSAFE247 240 crInitMutex(&cr_net.mutex); 248 #endif249 241 250 242 cr_net.initialized = 1; … … 305 297 if (!cr_net.initialized) return; 306 298 307 #ifdef CHROMIUM_THREADSAFE308 299 crLockMutex(&cr_net.mutex); 309 #endif310 300 311 301 /* Note, other protocols used by chromium should free up stuff too, … … 329 319 cr_net.initialized = 0; 330 320 331 #ifdef CHROMIUM_THREADSAFE332 321 crUnlockMutex(&cr_net.mutex); 333 322 crFreeMutex(&cr_net.mutex); 334 #endif335 323 } 336 324 … … 380 368 list->head = list->tail = NULL; 381 369 list->numMessages = 0; 382 #ifdef CHROMIUM_THREADSAFE383 370 crInitMutex(&list->lock); 384 371 crInitCondition(&list->nonEmpty); 385 #endif386 372 } 387 373 … … 400 386 CRMessageListNode *node; 401 387 402 #ifdef CHROMIUM_THREADSAFE403 388 crLockMutex(&list->lock); 404 #endif405 389 406 390 node = (CRMessageListNode *) crAlloc(sizeof(CRMessageListNode)); … … 419 403 list->numMessages++; 420 404 421 #ifdef CHROMIUM_THREADSAFE422 405 crSignalCondition(&list->nonEmpty); 423 406 crUnlockMutex(&list->lock); 424 #endif425 407 } 426 408 … … 437 419 int retval; 438 420 439 #ifdef CHROMIUM_THREADSAFE440 421 crLockMutex(&list->lock); 441 #endif442 422 443 423 if (list->head) { … … 467 447 } 468 448 469 #ifdef CHROMIUM_THREADSAFE470 449 crUnlockMutex(&list->lock); 471 #endif472 473 450 return retval; 474 451 } … … 488 465 CRMessageListNode *node; 489 466 490 #ifdef CHROMIUM_THREADSAFE491 467 crLockMutex(&list->lock); 492 #endif 493 494 #ifdef CHROMIUM_THREADSAFE 468 495 469 while (!list->head) { 496 470 crWaitCondition(&list->nonEmpty, &list->lock); 497 471 } 498 #else499 CRASSERT(list->head);500 #endif501 472 502 473 node = list->head; … … 518 489 519 490 crFree(node); 520 521 #ifdef CHROMIUM_THREADSAFE522 491 crUnlockMutex(&list->lock); 523 #endif524 492 } 525 493 … … 653 621 { 654 622 conn->Disconnect( conn ); 655 #ifdef CHROMIUM_THREADSAFE656 623 crFreeMutex( &conn->messageList.lock ); 657 #endif658 624 crFree( conn ); 659 625 }
Note:
See TracChangeset
for help on using the changeset viewer.