Author: ArcRiley
Date: 2009-01-10 10:42:36 -0500 (Sat, 10 Jan 2009)
New Revision: 1460

Removed:
   trunk/pysoy/src/_internals/_sleep.pym
Modified:
   trunk/pysoy/include/g.pxd
   trunk/pysoy/include/soy._internals.pxd
   trunk/pysoy/src/_core/Window-w32.pym
   trunk/pysoy/src/_core/Window-x11.pym
   trunk/pysoy/src/_core/_coreLoop.pym
   trunk/pysoy/src/_internals/Children.pym
   trunk/pysoy/src/_internals/LoopThread.pym
   trunk/pysoy/src/_internals/soy._internals.pyx
   trunk/pysoy/src/audio/_audioLoop.pym
   trunk/pysoy/src/windows/Window-X11.pym
Log:
replaced soy._internals._sleep(mseconds) with g.g_usleep(useconds)


Modified: trunk/pysoy/include/g.pxd
===================================================================
--- trunk/pysoy/include/g.pxd   2009-01-10 15:22:05 UTC (rev 1459)
+++ trunk/pysoy/include/g.pxd   2009-01-10 15:42:36 UTC (rev 1460)
@@ -111,5 +111,8 @@
   cdef gpointer      g_async_queue_pop            ( GAsyncQueue* )
 
   cdef gchar*      g_strdup                       ( gchar* )
+
+  void             g_usleep                       ( gulong )
+
   #
   #############################################################################

Modified: trunk/pysoy/include/soy._internals.pxd
===================================================================
--- trunk/pysoy/include/soy._internals.pxd      2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/include/soy._internals.pxd      2009-01-10 15:42:36 UTC (rev 
1460)
@@ -89,6 +89,5 @@
 
 
 # Extension-level C functions
-cdef void                _sleep        ( unsigned int )                   nogil
 cdef double              _time         ( )                                nogil
 cdef AsyncQueue          _getQueue     ( )

Modified: trunk/pysoy/src/_core/Window-w32.pym
===================================================================
--- trunk/pysoy/src/_core/Window-w32.pym        2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/_core/Window-w32.pym        2009-01-10 15:42:36 UTC (rev 
1460)
@@ -101,7 +101,7 @@
       for _i from 0 <= _i < 10000 :
         if self._opened == -1 :
           break
-        soy._internals._sleep(100)
+        g.g_usleep(100000)
       if self._opened != -1 :
         self._opened = -1
         raise SystemError('timed out while deallocating window')

Modified: trunk/pysoy/src/_core/Window-x11.pym
===================================================================
--- trunk/pysoy/src/_core/Window-x11.pym        2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/_core/Window-x11.pym        2009-01-10 15:42:36 UTC (rev 
1460)
@@ -66,7 +66,7 @@
   cdef void _openedWait(self, int _op) :
     # Use with care
     while self._opened < _op :
-      soy._internals._sleep(100)
+      g.g_usleep(100000)
 
 
   cdef void _create(self, int _x, int _y, int _width, int _height) :

Modified: trunk/pysoy/src/_core/_coreLoop.pym
===================================================================
--- trunk/pysoy/src/_core/_coreLoop.pym 2009-01-10 15:22:05 UTC (rev 1459)
+++ trunk/pysoy/src/_core/_coreLoop.pym 2009-01-10 15:42:36 UTC (rev 1460)
@@ -29,4 +29,4 @@
     for _i from 0 <= _i < _windows._current :
       (<Window> _windows._list[_i])._render()
     _windows._iterDone()
-    soy._internals._sleep(1)
+    g.g_usleep(1000)

Modified: trunk/pysoy/src/_internals/Children.pym
===================================================================
--- trunk/pysoy/src/_internals/Children.pym     2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/_internals/Children.pym     2009-01-10 15:42:36 UTC (rev 
1460)
@@ -87,7 +87,7 @@
     #
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     if self._size == self._current :
       self._size = self._size * 2
       self._list = <void**> py.PyMem_Realloc(self._list,
@@ -102,7 +102,7 @@
     py.PyThread_acquire_lock(self._lockMain, 1)
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     _offset = self._offset(_child)
     if _offset == -1 :
       return  
@@ -118,7 +118,7 @@
     py.PyThread_acquire_lock(self._lockMain, 1)
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     _offset = self._offset(_child)
     if _offset > 0 :
       # Swap the item with the one at the bottom of the list -
@@ -131,7 +131,7 @@
     py.PyThread_acquire_lock(self._lockMain, 1)
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     py.PyMem_Free(self._list)
     self._size = 1
     self._current = 0
@@ -166,7 +166,7 @@
     py.PyThread_acquire_lock(self._lockMain, 1)
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     _offset = self._offset(_child)
     if _offset > 0 :
       self._swap(_offset, _offset - 1)
@@ -178,7 +178,7 @@
     py.PyThread_acquire_lock(self._lockMain, 1)
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     _offset = self._offset(_child)
     if _offset == -1 :
       return  
@@ -193,7 +193,7 @@
     #
     # Wait until all iterations are complete
     while self._iters != 0 :
-      _sleep(1)
+      g.g_usleep(1000)
     _offset = self._offset(_child)
     if _offset == -1 :
       py.PyThread_release_lock(self._lockMain)

Modified: trunk/pysoy/src/_internals/LoopThread.pym
===================================================================
--- trunk/pysoy/src/_internals/LoopThread.pym   2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/_internals/LoopThread.pym   2009-01-10 15:42:36 UTC (rev 
1460)
@@ -99,7 +99,7 @@
       for _i from 0 <= _i < _most :
         if self._wake :
           break
-        _sleep(1)
+        g.g_usleep(1000)
     py.PyThread_release_lock(self._loopLock)
     stdio.printf('Finished C\n')
 

Deleted: trunk/pysoy/src/_internals/_sleep.pym
===================================================================
--- trunk/pysoy/src/_internals/_sleep.pym       2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/_internals/_sleep.pym       2009-01-10 15:42:36 UTC (rev 
1460)
@@ -1,37 +0,0 @@
-# PySoy's _internals._sleep Function
-#
-# Copyright (C) 2006,2007,2008,2009 PySoy Group
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU Affero General Public License as published
-#  by the Free Software Foundation, either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU Affero General Public License for more details.
-#
-#  You should have received a copy of the GNU Affero General Public License
-#  along with this program; if not, see http://www.gnu.org/licenses
-#
-# $Id$
-
-cdef void _sleep( unsigned int mseconds ) nogil :
-  #
-  # Cross-platform sleep function
-  #
-  #    This is pretty straight-forward.
-  #    We're using Microsoft's time units (1/1000th of a second) since it's
-  #    the lowest common denominator between the two (usleep is 1/1000000th)
-  #
-  IF UNAME_SYSNAME == "Windows" :
-    #
-    # 1 Microsoft Way (TM) -- ugh
-    # 
-    windows.Sleep(mseconds)
-  ELSE :
-    #
-    # Everyone else (GNU, Darwin, etc)
-    #
-    posix.usleep( mseconds * 1000 )

Modified: trunk/pysoy/src/_internals/soy._internals.pyx
===================================================================
--- trunk/pysoy/src/_internals/soy._internals.pyx       2009-01-10 15:22:05 UTC 
(rev 1459)
+++ trunk/pysoy/src/_internals/soy._internals.pyx       2009-01-10 15:42:36 UTC 
(rev 1460)
@@ -19,7 +19,6 @@
 
 include "__init__.pym"
 include "_getQueue.pym"
-include "_sleep.pym"
 include "_time.pym"
 include "AsyncQueue.pym"
 include "Children.pym"

Modified: trunk/pysoy/src/audio/_audioLoop.pym
===================================================================
--- trunk/pysoy/src/audio/_audioLoop.pym        2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/audio/_audioLoop.pym        2009-01-10 15:42:36 UTC (rev 
1460)
@@ -24,4 +24,4 @@
   #
   while (1) :
     # Do Stuff, and then
-    soy._internals._sleep(10)
+    g.g_usleep(10000)

Modified: trunk/pysoy/src/windows/Window-X11.pym
===================================================================
--- trunk/pysoy/src/windows/Window-X11.pym      2009-01-10 15:22:05 UTC (rev 
1459)
+++ trunk/pysoy/src/windows/Window-X11.pym      2009-01-10 15:42:36 UTC (rev 
1460)
@@ -92,7 +92,7 @@
   cdef void _openedWait(self, int _op) :
     # Use with care
     while self._opened < _op :
-      soy._internals._sleep(100)
+      g.g_usleep(100000)
 
   cdef void _create(self, int _x, int _y, int _width, int _height) :
     #

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to