1 typedef int perl_mutex;
4 typedef struct perl_thread *perl_os_thread;
5 /* With fake threads, thr is global(ish) so we don't need dTHR */
6 #define dTHR extern int errno
8 struct perl_wait_queue {
9 struct perl_thread * thread;
10 struct perl_wait_queue * next;
12 typedef struct perl_wait_queue *perl_cond;
14 /* Ask thread.h to include our per-thread extras */
15 #define HAVE_THREAD_INTERN
16 struct thread_intern {
17 perl_os_thread next_run, prev_run; /* Linked list of runnable threads */
18 perl_cond wait_queue; /* Wait queue that we are waiting on */
19 IV private; /* Holds data across time slices */
20 I32 savemark; /* Holds MARK for thread join values */
23 #define init_thread_intern(t) \
26 (t)->i.next_run = (t)->i.prev_run = (t); \
27 (t)->i.wait_queue = 0; \
32 * Note that SCHEDULE() is only callable from pp code (which
33 * must be expecting to be restarted). We'll have to do
34 * something a bit different for XS code.
37 #define SCHEDULE() return schedule(), PL_op
40 #define MUTEX_UNLOCK(m)
42 #define MUTEX_DESTROY(m)
43 #define COND_INIT(c) perl_cond_init(c)
44 #define COND_SIGNAL(c) perl_cond_signal(c)
45 #define COND_BROADCAST(c) perl_cond_broadcast(c)
46 #define COND_WAIT(c, m) \
51 #define COND_DESTROY(c)
53 #define THREAD_CREATE(t, f) f((t))
54 #define THREAD_POST_CREATE(t) NOOP