On Thu, 27 Mar 2008 14:24:46 -0700
Robert Bradshaw <[EMAIL PROTECTED]> wrote:

> 
> More likely to be thread-related--IIRC Cython calls the Python/C API  
> to do its imports (though I haven't looked into it enough to  
> completely absolve Cython of any potential guilt...)
> 
> - Robert

Yes. This is the solution I found to create a module singleton:


cdef void *_mux
mux = None

def get_mux():
    global _mux, mux
    if _mux == NULL:
        mux = Mux() # create singleton
        _mux = <void *>mux
    elif mux is None:
        mux = <object>_mux
    return mux


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to