Changeset 22690 in vbox
- Timestamp:
- Sep 2, 2009 1:46:58 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 51803
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r22686 r22690 47 47 #endif 48 48 49 #ifdef RT_OS_DARWIN 50 # include <CoreFoundation/CFRunLoop.h> 51 #endif 52 49 53 using namespace com; 50 54 … … 165 169 IN_BSTR flags) 166 170 { 171 RTPrintf("OnGuestPropertyChange:\n"); 167 172 Utf8Str utf8Name(name); 168 173 Guid uuid(machineId); … … 482 487 483 488 #ifdef USE_XPCOM_QUEUE 484 int const fdQueue 485 #endif 486 uint64_t const StartM illiTS = RTTimeMilliTS();489 int const fdQueue = a->eventQ->GetEventQueueSelectFD(); 490 #endif 491 uint64_t const StartMsTS = RTTimeMilliTS(); 487 492 for (;;) 488 493 { … … 502 507 else 503 508 { 504 uint64_t cMsElapsed = RTTimeMilliTS() - StartM illiTS;509 uint64_t cMsElapsed = RTTimeMilliTS() - StartMsTS; 505 510 if (cMsElapsed >= cMsTimeout) 506 511 break; /* timeout */ … … 509 514 510 515 /* Wait in a platform specific manner. */ 516 #define POLL_MS_INTERVAL 1000 511 517 #ifdef USE_XPCOM_QUEUE 512 518 fd_set fdset; … … 515 521 struct timeval tv; 516 522 if ( cMsLeft == RT_INDEFINITE_WAIT 517 || cMsLeft >= 1000)518 { 519 tv.tv_sec = 1;523 || cMsLeft >= POLL_MS_INTERVAL) 524 { 525 tv.tv_sec = POLL_MS_INTERVAL / 1000; 520 526 tv.tv_usec = 0; 521 527 } … … 531 537 break; 532 538 } 539 540 #elif defined(RT_OS_DARWIN) 541 CFTimeInterval rdTimeout = (double)RT_MIN(cMsLeft, POLL_MS_INTERVAL) / 1000; 542 OSStatus orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, rdTimeout, true /*returnAfterSourceHandled*/); 543 if (orc == kCFRunLoopRunHandledSource) 544 orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/); 545 if ( orc != 0 546 && orc != kCFRunLoopRunHandledSource 547 && orc != kCFRunLoopRunTimedOut) 548 { 549 RTPrintf("Error waiting for event: %d\n", orc); 550 break; 551 } 552 533 553 #else /* !USE_XPCOM_QUEUE */ 534 /** @todo make this faster on Mac OS X (and possible Windows+OS/2 too), we should probably use WaitNextEvent() to wait here. */ 535 int vrc = cbImpl->wait(RT_MIN(cMsLeft, 1000)); 554 int vrc = cbImpl->wait(RT_MIN(cMsLeft, POLL_MS_INTERVAL)); 536 555 if ( vrc != VERR_TIMEOUT 537 556 && RT_FAILURE(vrc))
Note:
See TracChangeset
for help on using the changeset viewer.