Changeset 22357 in vbox for trunk/src/libs
- Timestamp:
- Aug 19, 2009 9:32:54 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 51285
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r22164 r22357 1604 1604 // send address of the instance wrapper, and set the low bit to indicate 1605 1605 // to the remote party that this is a remote instance wrapper. 1606 PtrBits bits = ((PtrBits)(uintptr_t) wrapper) | PTRBITS_REMOTE_BIT; 1606 PtrBits bits = ((PtrBits)(uintptr_t) wrapper); 1607 NS_ASSERTION((bits & PTRBITS_REMOTE_BIT) == 0, "remote bit wrong)"); 1608 bits |= PTRBITS_REMOTE_BIT; 1607 1609 writer.PutBytes(&bits, sizeof(bits)); 1608 1610 } -
trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
r21300 r22357 493 493 494 494 #ifdef VBOX 495 495 496 static nsIEventQueue* g_mainEventQ = nsnull; 496 497 … … 575 576 PyXPCOMMethod_DeinitCOM(PyObject *self, PyObject *args) 576 577 { 577 Py_BEGIN_ALLOW_THREADS; 578 deinitVBoxPython(); 579 Py_END_ALLOW_THREADS; 580 return PyInt_FromLong(0); 578 Py_BEGIN_ALLOW_THREADS; 579 deinitVBoxPython(); 580 Py_END_ALLOW_THREADS; 581 return PyInt_FromLong(0); 582 } 583 584 static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); 585 586 static PyObject* 587 PyXPCOMMethod_AttachThread(PyObject *self, PyObject *args) 588 { 589 nsresult rv; 590 PRInt32 result = 0; 591 nsCOMPtr<nsIEventQueueService> eqs; 592 593 // Create the Event Queue for this thread... 594 Py_BEGIN_ALLOW_THREADS; 595 eqs = 596 do_GetService(kEventQueueServiceCID, &rv); 597 Py_END_ALLOW_THREADS; 598 if (NS_FAILED(rv)) 599 { 600 result = 1; 601 goto done; 602 } 603 604 Py_BEGIN_ALLOW_THREADS; 605 rv = eqs->CreateThreadEventQueue(); 606 Py_END_ALLOW_THREADS; 607 if (NS_FAILED(rv)) 608 { 609 result = 2; 610 goto done; 611 } 612 613 done: 614 /** @todo: better throw an exception on error */ 615 return PyInt_FromLong(result); 616 } 617 618 static PyObject* 619 PyXPCOMMethod_DetachThread(PyObject *self, PyObject *args) 620 { 621 nsresult rv; 622 PRInt32 result = 0; 623 nsCOMPtr<nsIEventQueueService> eqs; 624 625 // Destroy the Event Queue for this thread... 626 Py_BEGIN_ALLOW_THREADS; 627 eqs = 628 do_GetService(kEventQueueServiceCID, &rv); 629 Py_END_ALLOW_THREADS; 630 if (NS_FAILED(rv)) 631 { 632 result = 1; 633 goto done; 634 } 635 636 Py_BEGIN_ALLOW_THREADS; 637 rv = eqs->DestroyThreadEventQueue(); 638 Py_END_ALLOW_THREADS; 639 if (NS_FAILED(rv)) 640 { 641 result = 2; 642 goto done; 643 } 644 645 done: 646 /** @todo: better throw an exception on error */ 647 return PyInt_FromLong(result); 581 648 } 582 649 #endif … … 609 676 #ifdef VBOX 610 677 {"WaitForEvents", PyXPCOMMethod_WaitForEvents, 1}, 611 {"DeinitCOM", PyXPCOMMethod_DeinitCOM, 1}, 678 {"DeinitCOM", PyXPCOMMethod_DeinitCOM, 1}, 679 {"AttachThread", PyXPCOMMethod_AttachThread, 1}, 680 {"DetachThread", PyXPCOMMethod_DetachThread, 1}, 612 681 #endif 613 682 // These should no longer be used - just use the logging.getLogger('pyxpcom')...
Note:
See TracChangeset
for help on using the changeset viewer.