-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: Use 32-bit distribution of python
- Loading branch information
1 parent
6ca20ff
commit 4212164
Showing
166 changed files
with
175,623 additions
and
44,695 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
cimport cython | ||
|
||
# This file must not cimport anything from gevent. | ||
|
||
cdef wref | ||
|
||
cdef BlockingSwitchOutError | ||
|
||
|
||
cdef extern from "greenlet/greenlet.h": | ||
|
||
ctypedef class greenlet.greenlet [object PyGreenlet]: | ||
pass | ||
|
||
# These are actually macros and so much be included | ||
# (defined) in each .pxd, as are the two functions | ||
# that call them. | ||
greenlet PyGreenlet_GetCurrent() | ||
object PyGreenlet_Switch(greenlet self, void* args, void* kwargs) | ||
void PyGreenlet_Import() | ||
|
||
@cython.final | ||
cdef inline greenlet getcurrent(): | ||
return PyGreenlet_GetCurrent() | ||
|
||
cdef bint _greenlet_imported | ||
|
||
cdef inline void greenlet_init(): | ||
global _greenlet_imported | ||
if not _greenlet_imported: | ||
PyGreenlet_Import() | ||
_greenlet_imported = True | ||
|
||
cdef inline object _greenlet_switch(greenlet self): | ||
return PyGreenlet_Switch(self, NULL, NULL) | ||
|
||
cdef class TrackedRawGreenlet(greenlet): | ||
pass | ||
|
||
cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): | ||
cdef public loop | ||
|
||
cpdef switch(self) | ||
cpdef switch_out(self) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop | ||
|
||
cdef _threadlocal | ||
|
||
cpdef get_hub_class() | ||
cpdef SwitchOutGreenletWithLoop get_hub_if_exists() | ||
cpdef set_hub(SwitchOutGreenletWithLoop hub) | ||
cpdef get_loop() | ||
cpdef set_loop(loop) | ||
|
||
# We can't cdef this, it won't do varargs. | ||
# cpdef WaitOperationsGreenlet get_hub(*args, **kwargs) | ||
|
||
# XXX: TODO: Move the definition of TrackedRawGreenlet | ||
# into a file that can be cython compiled so get_hub can | ||
# return that. | ||
cpdef SwitchOutGreenletWithLoop get_hub_noargs() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
cimport cython | ||
|
||
from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop | ||
from gevent.__hub_local cimport get_hub_noargs as get_hub | ||
|
||
from gevent.__waiter cimport Waiter | ||
from gevent.__waiter cimport MultipleWaiter | ||
|
||
cdef InvalidSwitchError | ||
cdef _waiter | ||
cdef _greenlet_primitives | ||
cdef traceback | ||
cdef _timeout_error | ||
cdef Timeout | ||
|
||
|
||
cdef extern from "greenlet/greenlet.h": | ||
|
||
ctypedef class greenlet.greenlet [object PyGreenlet]: | ||
pass | ||
|
||
# These are actually macros and so much be included | ||
# (defined) in each .pxd, as are the two functions | ||
# that call them. | ||
greenlet PyGreenlet_GetCurrent() | ||
void PyGreenlet_Import() | ||
|
||
@cython.final | ||
cdef inline greenlet getcurrent(): | ||
return PyGreenlet_GetCurrent() | ||
|
||
cdef bint _greenlet_imported | ||
|
||
cdef inline void greenlet_init(): | ||
global _greenlet_imported | ||
if not _greenlet_imported: | ||
PyGreenlet_Import() | ||
_greenlet_imported = True | ||
|
||
|
||
cdef class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): | ||
|
||
cpdef wait(self, watcher) | ||
cpdef cancel_wait(self, watcher, error, close_watcher=*) | ||
cpdef _cancel_wait(self, watcher, error, close_watcher) | ||
|
||
cdef class _WaitIterator: | ||
cdef SwitchOutGreenletWithLoop _hub | ||
cdef MultipleWaiter _waiter | ||
cdef _switch | ||
cdef _timeout | ||
cdef _objects | ||
cdef _timer | ||
cdef Py_ssize_t _count | ||
cdef bint _begun | ||
|
||
|
||
|
||
cdef _cleanup(self) | ||
|
||
cpdef iwait_on_objects(objects, timeout=*, count=*) | ||
cpdef wait_on_objects(objects=*, timeout=*, count=*) | ||
|
||
cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) | ||
cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) | ||
cpdef wait_read(fileno, timeout=*, timeout_exc=*) | ||
cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) | ||
cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) | ||
cpdef wait_on_socket(socket, watcher, timeout_exc=*) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cimport cython | ||
|
||
cdef extern from "Python.h": | ||
|
||
ctypedef class weakref.ref [object PyWeakReference]: | ||
pass | ||
|
||
cdef heappop | ||
cdef heappush | ||
cdef object WeakKeyDictionary | ||
cdef type ref | ||
|
||
@cython.internal | ||
@cython.final | ||
cdef class ValuedWeakRef(ref): | ||
cdef object value | ||
|
||
@cython.final | ||
cdef class IdentRegistry: | ||
cdef object _registry | ||
cdef list _available_idents | ||
|
||
@cython.final | ||
cpdef object get_ident(self, obj) | ||
@cython.final | ||
cpdef _return_ident(self, ValuedWeakRef ref) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
cimport cython | ||
from gevent._greenlet cimport Greenlet | ||
from gevent.__semaphore cimport Semaphore | ||
from gevent._queue cimport UnboundQueue | ||
|
||
@cython.freelist(100) | ||
@cython.internal | ||
@cython.final | ||
cdef class Failure: | ||
cdef readonly exc | ||
cdef raise_exception | ||
|
||
cdef inline _raise_exc(Failure failure) | ||
|
||
cdef class IMapUnordered(Greenlet): | ||
cdef bint _zipped | ||
cdef func | ||
cdef iterable | ||
cdef spawn | ||
cdef Semaphore _result_semaphore | ||
cdef int _outstanding_tasks | ||
cdef int _max_index | ||
|
||
cdef readonly UnboundQueue queue | ||
cdef readonly bint finished | ||
|
||
cdef _inext(self) | ||
cdef _ispawn(self, func, item, int item_index) | ||
|
||
# Passed to greenlet.link | ||
cpdef _on_result(self, greenlet) | ||
# Called directly | ||
cdef _on_finish(self, exception) | ||
|
||
cdef _iqueue_value_for_success(self, greenlet) | ||
cdef _iqueue_value_for_failure(self, greenlet) | ||
cdef _iqueue_value_for_self_finished(self) | ||
cdef _iqueue_value_for_self_failure(self, exception) | ||
|
||
cdef class IMap(IMapUnordered): | ||
cdef int index | ||
cdef dict _results | ||
|
||
@cython.locals(index=int) | ||
cdef _inext(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
33 changes: 32 additions & 1 deletion
33
python/gevent/_semaphore.pxd → python/gevent/__semaphore.pxd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.