/* fakethr.h
*
* Copyright (C) 1999, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
*/
typedef int perl_mutex;
typedef int perl_key;
/* With fake threads, thr is global(ish) so we don't need dTHR */
struct perl_wait_queue {
};
/* Ask thread.h to include our per-thread extras */
#define HAVE_THREAD_INTERN
struct thread_intern {
};
#define init_thread_intern(t) \
STMT_START { \
t->self = (t); \
(t)->i.wait_queue = 0; \
(t)->i.private = 0; \
} STMT_END
/*
* Note that SCHEDULE() is only callable from pp code (which
* must be expecting to be restarted). We'll have to do
* something a bit different for XS code.
*/
#define MUTEX_LOCK(m)
#define MUTEX_UNLOCK(m)
#define MUTEX_INIT(m)
#define MUTEX_DESTROY(m)
#define COND_WAIT(c, m) \
STMT_START { \
perl_cond_wait(c); \
SCHEDULE(); \
} STMT_END
#define COND_DESTROY(c)
#define THREAD_CREATE(t, f) f((t))