view runtime/thread.h @ 75:0083b2f7b3c7

Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
author Mike Pavone <pavone@retrodev.com>
date Tue, 06 Jul 2010 07:52:59 -0400
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_