Permalink
Browse files

Patch which modifies event handling loop for Darwin, to allow easier …

…interruption.

git-svn-id: http://vboxweb.googlecode.com/svn/trunk@68 729376a8-6c6b-11de-afdd-bb9f892af8c1
  • Loading branch information...
1 parent 41fcd33 commit 13089cd5fe4edc492947fcf2a5814e4c37c04c0e vboxweb committed Aug 24, 2009
Showing with 11 additions and 0 deletions.
  1. +11 −0 VBoxWebSrv.py
View
@@ -564,7 +564,18 @@ def main(argv = sys.argv):
# Events loop, wait for keyboard interrupt
global g_bTerminated
try:
+ # Darwin-specific uglyness
+ if sys.platform == 'darwin':
+ import time
while not g_bTerminated:
+ # We have no timed waits on Darwin, and waitForEvents(-1)
+ # blocks signal delivery for some reasons, thus we cannot send
+ # wait interrupt notifcation.
+ # Instead we cheat a bit and just sleep() between events
+ g_virtualBoxManager.waitForEvents(0)
+ time.sleep(0.3)
+ else:
+ while not g_bTerminated:
g_virtualBoxManager.waitForEvents(-1)
except KeyboardInterrupt:
pass

0 comments on commit 13089cd

Please sign in to comment.