Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 13089cd5fe4edc492947fcf2a5814e4c37c04c0e 1 parent 41fcd33
vboxweb authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 VBoxWebSrv.py
11 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
Please sign in to comment.
Something went wrong with that request. Please try again.