43 #ifdef GECODE_THREADS_WINDOWS 50 # define _WIN32_WINNT 0x400 53 #ifndef WIN32_LEAN_AND_MEAN 54 # define WIN32_LEAN_AND_MEAN 61 #ifdef GECODE_THREADS_PTHREADS 65 #ifdef GECODE_THREADS_OSX 67 #include <libkern/OSAtomic.h> 88 namespace Gecode {
namespace Support {
101 #ifdef GECODE_THREADS_WINDOWS 102 CRITICAL_SECTION w_cs;
105 #ifdef GECODE_THREADS_PTHREADS 121 static void*
operator new(
size_t s);
123 static void operator delete(
void*
p);
128 void operator=(
const Mutex&) {}
131 #if defined(GECODE_THREADS_WINDOWS) || !defined(GECODE_THREADS_PTHREADS) 137 #ifdef GECODE_THREADS_PTHREADS 139 #if defined(GECODE_THREADS_OSX) || defined(GECODE_THREADS_PTHREADS_SPINLOCK) 157 #ifdef GECODE_THREADS_OSX 161 pthread_spinlock_t p_s;
176 static void*
operator new(
size_t s);
178 static void operator delete(
void*
p);
183 void operator=(
const FastMutex&) {}
212 void operator=(
const Lock&) {}
225 #ifdef GECODE_THREADS_WINDOWS 229 #ifdef GECODE_THREADS_PTHREADS 250 void operator=(
const Event&) {}
266 void todelete(
bool d);
268 bool todelete(
void)
const;
270 virtual void run(
void) = 0;
274 static void*
operator new(
size_t s);
276 static void operator delete(
void*
p);
308 static void*
operator new(
size_t s);
310 static void operator delete(
void*
p);
328 static void sleep(
unsigned int ms);
330 static unsigned int npu(
void);
335 void operator=(
const Thread&) {}
Mutex m
Mutex for synchronization.
virtual ~Runnable(void)
Destructor.
An interface for objects that can be run by a thread.
Mutex(void)
Initialize mutex.
void acquire(void)
Acquire the mutex and possibly block.
Runnable * r
Runnable object to execute.
A mutex for mutual exclausion among several threads.
void release(void)
Release the mutex.
int p
Number of positive literals for node type.
An event for synchronization.
A lock as a scoped frontend for a mutex.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
bool tryacquire(void)
Try to acquire the mutex, return true if succesful.
#define GECODE_SUPPORT_EXPORT
~Mutex(void)
Delete mutex.
static Run * idle
Idle runners.
Post propagator for SetVar SetOpType SetVar SetRelType r
Event e
Event to wait for next runnable object to execute.
Gecode toplevel namespace