Changeset 1265

Show
Ignore:
Timestamp:
05/18/08 13:14:51 (5 months ago)
Author:
ArcRiley
Message:

Pyrex 0.9.8.2 fixes :

  • now requires 0.9.8.2
  • nogil goes everywhere
  • a few functions got GIL-cleaned
  • still doesn't compile, but many steps closer
Location:
trunk/pysoy
Files:
29 modified

Legend:

Unmodified
Added
Removed
  • trunk/pysoy/include/gl.pxd

    r1191 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "GL/glew.h" : 
     20cdef extern from "GL/glew.h" nogil : 
    2121  ctypedef enum : 
    2222    # Boolean Values 
  • trunk/pysoy/include/glib.pxd

    r1191 r1265  
    1919 
    2020 
    21 cdef extern from "glib.h" : 
     21cdef extern from "glib.h" nogil : 
    2222  ctypedef void*           gpointer 
    2323  ctypedef void*           gconstpointer 
  • trunk/pysoy/include/ode.pxd

    r1191 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "ode/ode.h" : 
     20cdef extern from "ode/ode.h" nogil : 
    2121  ctypedef enum : 
    2222    #common 
  • trunk/pysoy/include/ogg.pxd

    r1191 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "ogg/ogg.h" : 
     20cdef extern from "ogg/ogg.h" nogil : 
    2121  ctypedef short           ogg_int16_t 
    2222  ctypedef unsigned short  ogg_uint16_t 
     
    147147 
    148148 
    149 cdef extern from "vorbis/codec.h" : 
     149cdef extern from "vorbis/codec.h" nogil : 
    150150  ctypedef enum : 
    151151    OV_FALSE 
     
    268268 
    269269 
    270 cdef extern from "theora/theora.h" : 
     270cdef extern from "theora/theora.h" nogil : 
    271271  ctypedef enum : 
    272272    OC_FAULT 
  • trunk/pysoy/include/posix.pxd

    r1191 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "sys/time.h" : 
     20cdef extern from "sys/time.h" nogil : 
    2121  cdef struct timeval : 
    2222    long int    tv_sec 
     
    2424  int gettimeofday (timeval *tv, void *tz ) 
    2525 
    26 cdef extern from "unistd.h" : 
     26cdef extern from "unistd.h" nogil : 
    2727  void usleep(unsigned long usec) 
  • trunk/pysoy/include/soy._datatypes.pxd

    r1259 r1265  
    5858    float ty 
    5959    float tz 
    60     float tan_x 
    61     float tan_y 
    62     float tan_z 
     60    float ux 
     61    float uy 
     62    float uz 
    6363 
    6464  struct Range : 
  • trunk/pysoy/include/soy._internals.pxd

    r1241 r1265  
    2222cdef class AsyncQueue : 
    2323  cdef glib.GAsyncQueue* _asyncqueue 
    24   cdef void              _push         ( self, void* ) 
     24  cdef void              _push         ( self, void* )                    nogil 
    2525  cdef object            _pop          ( self ) 
    2626 
     
    3737  cdef void*             _lockIter 
    3838  # Internal C functions 
    39   cdef int               _offset       ( self, void* ) 
    40   cdef void              _swap         ( self, int, int ) 
     39  cdef int               _offset       ( self, void* )                    nogil 
     40  cdef void              _swap         ( self, int, int )                 nogil 
    4141  # External C functions 
    42   cdef void              _append       ( self, void* ) 
    43   cdef void              _bottom       ( self, void* ) 
    44   cdef void              _empty        ( self ) 
    45   cdef int               _index        ( self, void* ) 
    46   cdef void              _iterDone     ( self ) 
    47   cdef void              _iterStart    ( self ) 
    48   cdef void              _lower        ( self, void* ) 
    49   cdef void              _raise        ( self, void* ) 
    50   cdef void              _remove       ( self, void* ) 
    51   cdef void              _top          ( self, void* ) 
     42  cdef void              _append       ( self, void* )                    nogil 
     43  cdef void              _bottom       ( self, void* )                    nogil 
     44  cdef void              _empty        ( self )                           nogil 
     45  cdef int               _index        ( self, void* )                    nogil 
     46  cdef void              _iterDone     ( self )                           nogil 
     47  cdef void              _iterStart    ( self )                           nogil 
     48  cdef void              _lower        ( self, void* )                    nogil 
     49  cdef void              _raise        ( self, void* )                    nogil 
     50  cdef void              _remove       ( self, void* )                    nogil 
     51  cdef void              _top          ( self, void* )                    nogil 
    5252 
    5353 
     
    5555  cdef object            _source 
    5656  cdef int               _state 
    57   cdef int               _load         ( self, void*, int ) 
    58   cdef int               _save         ( self, void*, int ) 
    59   cdef int               _ready        ( self ) 
     57  cdef int               _load         ( self, void*, int )               nogil 
     58  cdef int               _save         ( self, void*, int )               nogil 
     59  cdef int               _ready        ( self )                           nogil 
    6060 
    6161 
    6262cdef class Loopable : 
    63   cdef int               _loop         ( self ) 
    64  
     63  cdef int               _loop         ( self )                           nogil 
    6564 
    6665cdef class LoopThread : 
     
    7675  cdef object            _active 
    7776  cdef object            _active_limbo_lock 
    78   cdef void              _loop         ( self ) 
    79   cdef void              _append       ( self, void* ) 
    80   cdef void              _remove       ( self, void* ) 
     77  cdef void              _loop         ( self )                           nogil 
     78  cdef void              _append       ( self, void* )                    nogil 
     79  cdef void              _remove       ( self, void* )                    nogil 
    8180 
    8281 
    8382cdef class PointerSet : 
    8483  cdef glib.GHashTable*  _hashtable 
    85   cdef void              _insert       ( self, void* ) 
    86   cdef int               _has_key      ( self, void* ) 
    87   cdef int               _remove       ( self, void* ) 
    88   cdef void              _empty        ( self ) 
    89   cdef void              _foreach      ( self, glib.GHFunc, void* ) 
     84  cdef void              _insert       ( self, void* )                    nogil 
     85  cdef int               _has_key      ( self, void* )                    nogil 
     86  cdef int               _remove       ( self, void* )                    nogil 
     87  cdef void              _empty        ( self )                           nogil 
     88  cdef void              _foreach      ( self, glib.GHFunc, void* )       nogil 
    9089 
    9190 
    9291# Extension-level C functions 
    93 cdef void                _sleep        ( unsigned int ) 
    94 cdef double              _time         ( ) 
     92cdef void                _sleep        ( unsigned int )                   nogil 
     93cdef double              _time         ( )                                nogil 
    9594cdef AsyncQueue          _getQueue     ( ) 
  • trunk/pysoy/include/soy.fields.pxd

    r1241 r1265  
    2323 
    2424cdef class Field (soy.bodies.Body) : 
    25   cdef void             _give(self, int ccyle) 
    26   cdef int              _apply(self) 
    27   cdef int              _exert(self, soy.bodies.Body other) 
    28   cdef void             _commit(self) 
    29   cdef void             _render(self) 
     25  cdef void                     _give            ( self, int ) 
     26  cdef int                      _apply           ( self ) 
     27  cdef int                      _exert           ( self, soy.bodies.Body )  
     28  cdef void                     _commit          ( self )                  
     29  cdef void                     _render          ( self )                 nogil 
    3030 
    3131cdef class Monopole (Field) : 
  • trunk/pysoy/include/soy.textures.pxd

    r1241 r1265  
    4545  cdef int          _formats[5] 
    4646  # General C functions 
    47   cdef void         _resize(self, int, int, int, int, int) 
    48   cdef int          _squareup(self, int) 
     47  cdef void         _resize(self, int, int, int, int, int)                nogil 
     48  cdef int          _squareup(self, int)                                  nogil 
    4949  # WindowLoop functions 
    5050  cdef void         _enable(self) 
  • trunk/pysoy/include/soy.transports.pxd

    r1241 r1265  
    4444  # General Functions 
    4545  cdef int                     _initObjt       ( self, int, object, object ) 
    46   cdef int                     _indexName      ( self, char*, unsigned char ) 
    47   cdef int                     _indexSerial    ( self, int ) 
     46  cdef int                     _indexName      ( self, char*, 
     47                                                 unsigned char )          nogil 
     48  cdef int                     _indexSerial    ( self, int )              nogil 
    4849  # 
    4950  # Transport-specific functions 
    5051  cdef int                     _open           ( self, object ) 
    51   cdef int                     _read           ( self, char*, int ) 
    52   cdef int                     _write          ( self, char*, int ) 
    53   cdef int                     _goto           ( self, long ) 
    54   cdef int                     _seek           ( self, long ) 
    55   cdef long                    _tell           ( self ) 
    56   cdef void                    _rewind         ( self ) 
    57   cdef void                    _close          ( self ) 
     52  cdef int                     _read           ( self, char*, int )       nogil  
     53  cdef int                     _write          ( self, char*, int )       nogil 
     54  cdef int                     _goto           ( self, long )             nogil 
     55  cdef int                     _seek           ( self, long )             nogil 
     56  cdef long                    _tell           ( self )                   nogil 
     57  cdef void                    _rewind         ( self )                   nogil 
     58  cdef void                    _close          ( self )                   nogil 
    5859  # 
    5960  # Soy functions 
    6061  cdef void                    _soyHead        ( self ) 
    61   cdef void                    _soyLoad        ( self ) 
    62   cdef void                    _soyRead        ( self, char*, int ) 
     62  cdef void                    _soyLoad        ( self )                   nogil 
     63  cdef void                    _soyRead        ( self, char*, int )       nogil 
    6364  # 
    6465  # Ogg functions 
    6566  cdef void                    _oggHead        ( self ) 
    66   cdef void                    _oggLoad        ( self ) 
    67   cdef int                     _oggReadPage    ( self, ogg.ogg_page* ) 
     67  cdef void                    _oggLoad        ( self )                   nogil 
     68  cdef int                     _oggReadPage    ( self, ogg.ogg_page* )    nogil 
    6869 
    6970 
  • trunk/pysoy/include/stdio.pxd

    r1191 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "stdio.h" : 
     20cdef extern from "stdio.h" nogil : 
    2121  ctypedef enum : 
    2222    SEEK_SET 
     
    3232  void  rewind  ( void* ) 
    3333 
    34 cdef extern from "signal.h" : 
     34cdef extern from "signal.h" nogil : 
    3535  int   c_raise "raise" ( int ) 
  • trunk/pysoy/include/windows.pxd

    r1239 r1265  
    1818# $Id$ 
    1919 
    20 cdef extern from "windows.h": 
     20cdef extern from "windows.h" nogil : 
    2121  ctypedef void* HDC # handle to device context 
    2222  ctypedef void* HGLRC # handle to GL rendering context 
  • trunk/pysoy/setup.py

    r1262 r1265  
    2727from Pyrex.Compiler import Main 
    2828 
    29 if Main.Version.version < '0.9.8' : 
    30   raise SystemError('Pyrex version 0.9.8 is required.') 
     29if Main.Version.version < '0.9.8.2' : 
     30  raise SystemError('Pyrex version 0.9.8.2 or higher is required.') 
    3131 
    3232version = 'Trunk' 
  • trunk/pysoy/src/_datatypes/VertexList.pym

    r1259 r1265  
    247247        _vert_light_pos[2] = _vert_light_pos[2] / _lgt 
    248248        # 
    249         _binormal[0] = self._array[_i].tan_y * self._array[_i].nz - \ 
    250                        self._array[_i].tan_z * self._array[_i].ny 
    251         _binormal[1] = self._array[_i].tan_z * self._array[_i].nx - \ 
    252                        self._array[_i].tan_x * self._array[_i].nz 
    253         _binormal[2] = self._array[_i].tan_x * self._array[_i].ny - \ 
    254                        self._array[_i].tan_y * self._array[_i].nx 
     249        _binormal[0] = self._array[_i].uy * self._array[_i].nz - \ 
     250                       self._array[_i].uz * self._array[_i].ny 
     251        _binormal[1] = self._array[_i].uz * self._array[_i].nx - \ 
     252                       self._array[_i].ux * self._array[_i].nz 
     253        _binormal[2] = self._array[_i].ux * self._array[_i].ny - \ 
     254                       self._array[_i].uy * self._array[_i].nx 
    255255        #               
    256         self._tslvArray[3*_i+0] = ( _vert_light_pos[0] * self._array[_i].tan_x\ 
    257                                    +_vert_light_pos[1] * self._array[_i].tan_y\ 
    258                                    +_vert_light_pos[2] * self._array[_i].tan_z) 
     256        self._tslvArray[3*_i+0] = ( _vert_light_pos[0] * self._array[_i].ux\ 
     257                                   +_vert_light_pos[1] * self._array[_i].uy\ 
     258                                   +_vert_light_pos[2] * self._array[_i].uz) 
    259259        self._tslvArray[3*_i+1] = ( _vert_light_pos[0] * _binormal[0] \ 
    260260                                   +_vert_light_pos[1] * _binormal[1] \ 
  • trunk/pysoy/src/_internals/AsyncQueue.pym

    r1263 r1265  
    4343  # 
    4444   
    45   cdef void _push(self, void* data) : 
     45  cdef void _push(self, void* data) nogil : 
    4646    glib.g_async_queue_push(self._asyncqueue, data) 
    4747 
  • trunk/pysoy/src/_internals/Children.pym

    r1233 r1265  
    6363  # 
    6464 
    65   cdef int _offset(self, void* _child) : 
     65  cdef int _offset(self, void* _child) nogil : 
    6666    cdef int _i 
    6767    for _i from 0 <= _i < self._current : 
     
    7171 
    7272 
    73   cdef void _swap(self, int _first, int _second) : 
     73  cdef void _swap(self, int _first, int _second) nogil : 
    7474    cdef void* _sibling 
    7575    _sibling = self._list[_first] 
     
    8383  # 
    8484 
    85   cdef void _append(self, void* _child) : 
     85  cdef void _append(self, void* _child) nogil : 
    8686    py.PyThread_acquire_lock(self._lockMain, 1) 
    8787    # 
     
    9898 
    9999 
    100   cdef void _top(self, void* _child) : 
     100  cdef void _top(self, void* _child) nogil : 
    101101    cdef int _offset 
    102102    py.PyThread_acquire_lock(self._lockMain, 1) 
     
    114114 
    115115 
    116   cdef void _bottom(self, void* _child) : 
     116  cdef void _bottom(self, void* _child) nogil : 
    117117    cdef int _offset 
    118118    py.PyThread_acquire_lock(self._lockMain, 1) 
     
    128128 
    129129 
    130   cdef void _empty(self) : 
     130  cdef void _empty(self) nogil : 
    131131    py.PyThread_acquire_lock(self._lockMain, 1) 
    132132    # Wait until all iterations are complete 
     
    140140 
    141141 
    142   cdef int _index(self, void* _child) : 
     142  cdef int _index(self, void* _child) nogil : 
    143143    cdef int _i 
    144144    self._iterStart() 
     
    148148     
    149149 
    150   cdef void _iterDone(self) : 
     150  cdef void _iterDone(self) nogil : 
    151151    py.PyThread_acquire_lock(self._lockIter, 1) 
    152152    self._iters = self._iters - 1 
     
    154154   
    155155 
    156   cdef void _iterStart(self) : 
     156  cdef void _iterStart(self) nogil : 
    157157    py.PyThread_acquire_lock(self._lockMain, 1) 
    158158    py.PyThread_acquire_lock(self._lockIter, 1) 
     
    162162 
    163163 
    164   cdef void _lower(self, void* _child) : 
     164  cdef void _lower(self, void* _child) nogil : 
    165165    cdef int _offset 
    166166    py.PyThread_acquire_lock(self._lockMain, 1) 
     
    174174 
    175175 
    176   cdef void _raise(self, void* _child) : 
     176  cdef void _raise(self, void* _child) nogil : 
    177177    cdef int _offset 
    178178    py.PyThread_acquire_lock(self._lockMain, 1) 
     
    188188 
    189189 
    190   cdef void _remove(self, void* _child) : 
     190  cdef void _remove(self, void* _child) nogil : 
    191191    cdef int _i, _offset 
    192192    py.PyThread_acquire_lock(self._lockMain, 1) 
  • trunk/pysoy/src/_internals/Loadable.pym

    r1233 r1265  
    3939  # 
    4040   
    41   cdef int _load(self, void* _data, int _size) : 
     41  cdef int _load(self, void* _data, int _size) nogil : 
    4242    return 0 
    4343 
    44   cdef int _save(self, void* _data, int _size) : 
     44  cdef int _save(self, void* _data, int _size) nogil : 
    4545    return 0 
    4646 
    47   cdef int _ready(self) : 
     47  cdef int _ready(self) nogil : 
    4848    return 0 
  • trunk/pysoy/src/_internals/LoopThread.pym

    r1233 r1265  
    8484  # 
    8585   
    86   cdef void _loop(self) : 
     86  cdef void _loop(self) nogil : 
    8787    cdef int _i, _t, _most 
    8888    # 
     
    104104    stdio.printf('Finished C\n') 
    105105 
    106   cdef void _append(self, void* _child) : 
     106 
     107  cdef void _append(self, void* _child) nogil : 
    107108    py.PyThread_acquire_lock(self._listLock, 1) 
    108109    if self._size == self._current : 
     
    114115    py.PyThread_release_lock(self._listLock) 
    115116 
    116   cdef void _remove(self, void* _child) : 
     117 
     118  cdef void _remove(self, void* _child) nogil : 
    117119    cdef int _i, _j 
    118120    py.PyThread_acquire_lock(self._listLock, 1) 
  • trunk/pysoy/src/_internals/Loopable.pym

    r1233 r1265  
    2929  # 
    3030   
    31   cdef int _loop(self) : 
     31  cdef int _loop(self) nogil : 
    3232    return 1000 
  • trunk/pysoy/src/_internals/PointerSet.pym

    r1233 r1265  
    4040  # 
    4141   
    42   cdef void _insert(self, void* key) : 
     42  cdef void _insert(self, void* key) nogil : 
    4343    glib.g_hash_table_insert(self._hashtable, key, NULL) 
    4444 
    45   cdef int _has_key(self, void* key) : 
     45  cdef int _has_key(self, void* key) nogil : 
    4646    cdef glib.gpointer k, d 
    4747    return glib.g_hash_table_lookup_extended(self._hashtable, key, &k, &d) 
    4848   
    49   cdef int _remove(self, void* key) : 
     49  cdef int _remove(self, void* key) nogil : 
    5050    return glib.g_hash_table_remove(self._hashtable, key) 
    5151 
    52   cdef void _empty(self) : 
     52  cdef void _empty(self) nogil : 
    5353    glib.g_hash_table_remove_all(self._hashtable) 
    5454 
    55   cdef void _foreach(self, glib.GHFunc function, void* user_data) : 
     55  cdef void _foreach(self, glib.GHFunc function, void* user_data) nogil : 
    5656    glib.g_hash_table_foreach(self._hashtable, function, user_data) 
  • trunk/pysoy/src/_internals/_sleep.pym

    r1249 r1265  
    1818# $Id$ 
    1919 
    20 cdef void _sleep( unsigned int mseconds ) : 
     20cdef void _sleep( unsigned int mseconds ) nogil : 
    2121  # 
    2222  # Cross-platform sleep function 
  • trunk/pysoy/src/_internals/_time.pym