Track /etc/gitconfig
[msysgit/mtrensch.git] / lib / perl5 / 5.8.8 / msys / CORE / fakethr.h
blob8f0def43f4df5cba6699f85f1f1b85f4ca514517
1 /* fakethr.h
3 * Copyright (C) 1999, by Larry Wall and others
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
8 */
10 typedef int perl_mutex;
11 typedef int perl_key;
13 typedef struct perl_thread *perl_os_thread;
14 /* With fake threads, thr is global(ish) so we don't need dTHR */
15 #define dTHR extern int errno
17 struct perl_wait_queue {
18 struct perl_thread * thread;
19 struct perl_wait_queue * next;
21 typedef struct perl_wait_queue *perl_cond;
23 /* Ask thread.h to include our per-thread extras */
24 #define HAVE_THREAD_INTERN
25 struct thread_intern {
26 perl_os_thread next_run, prev_run; /* Linked list of runnable threads */
27 perl_cond wait_queue; /* Wait queue that we are waiting on */
28 IV private; /* Holds data across time slices */
29 I32 savemark; /* Holds MARK for thread join values */
32 #define init_thread_intern(t) \
33 STMT_START { \
34 t->self = (t); \
35 (t)->i.next_run = (t)->i.prev_run = (t); \
36 (t)->i.wait_queue = 0; \
37 (t)->i.private = 0; \
38 } STMT_END
41 * Note that SCHEDULE() is only callable from pp code (which
42 * must be expecting to be restarted). We'll have to do
43 * something a bit different for XS code.
46 #define SCHEDULE() return schedule(), PL_op
48 #define MUTEX_LOCK(m)
49 #define MUTEX_UNLOCK(m)
50 #define MUTEX_INIT(m)
51 #define MUTEX_DESTROY(m)
52 #define COND_INIT(c) perl_cond_init(c)
53 #define COND_SIGNAL(c) perl_cond_signal(c)
54 #define COND_BROADCAST(c) perl_cond_broadcast(c)
55 #define COND_WAIT(c, m) \
56 STMT_START { \
57 perl_cond_wait(c); \
58 SCHEDULE(); \
59 } STMT_END
60 #define COND_DESTROY(c)
62 #define THREAD_CREATE(t, f) f((t))
63 #define THREAD_POST_CREATE(t) NOOP
65 #define YIELD NOOP