view runtime/thread.h @ 136:fc3815b7462f

Javascript backend now produces working code for some simple examples, still more of the standard lib that needs to be ported.
author Mike Pavone <pavone@retrodev.com>
date Sun, 14 Nov 2010 23:07:55 -0500
parents d61550e2c001
children
line wrap: on
line source

#ifndef _THREAD_H_
#define _THREAD_H_
#include "plat_types.h"

#ifdef USE_THREADS

#include "plat_thread.h"

#else

#define rh_atomic32(var) int32_t var
#define rh_atomic_add(parent,var,val) (parent)->var += (val)
#define rh_atomic_sub(parent,var,val) (parent)->var -= (val)
#define rh_atomic_sub_testzero(parent,var,val) (((parent)->var -= (val)) == 0)
#define rh_atomic_set(parent,var,val) (parent)->var = val
#define rh_atomic_get(parent,var) ((parent)->var)

#define rh_start_thread(func,data,name)
#define rh_mutex(var)
#define rh_mutex_init(var)
#define rh_lock(lock)
#define rh_unlock(lock)
#define rh_mutex_del(var)

#endif //USE_THREADS

#endif //_THREAD_H_