… | |
… | |
57 | |
57 | |
58 | #include "CoroAPI.h" |
58 | #include "CoroAPI.h" |
59 | |
59 | |
60 | #ifdef USE_ITHREADS |
60 | #ifdef USE_ITHREADS |
61 | static perl_mutex coro_mutex; |
61 | static perl_mutex coro_mutex; |
62 | # define LOCK do { MUTEX_LOCK (&coro_mutex); } while (0) |
62 | # define LOCK do { MUTEX_LOCK (&coro_mutex); } while (0) |
63 | # define UNLOCK do { MUTEX_UNLOCK (&coro_mutex); } while (0) |
63 | # define UNLOCK do { MUTEX_UNLOCK (&coro_mutex); } while (0) |
64 | #else |
64 | #else |
65 | # define LOCK 0 |
65 | # define LOCK (void)0 |
66 | # define UNLOCK 0 |
66 | # define UNLOCK (void)0 |
67 | #endif |
67 | #endif |
68 | |
68 | |
69 | static struct CoroAPI coroapi; |
69 | static struct CoroAPI coroapi; |
70 | static AV *main_mainstack; /* used to differentiate between $main and others */ |
70 | static AV *main_mainstack; /* used to differentiate between $main and others */ |
71 | static HV *coro_state_stash; |
71 | static HV *coro_state_stash; |