39 #ifdef GECODE_THREADS_WINDOWS 46 # define _WIN32_WINNT 0x400 49 #ifndef WIN32_LEAN_AND_MEAN 50 # define WIN32_LEAN_AND_MEAN 57 #ifdef GECODE_THREADS_PTHREADS 61 #ifdef GECODE_THREADS_OSX_UNFAIR 64 #include <libkern/OSAtomic.h> 85 namespace Gecode {
namespace Support {
98 #if defined(GECODE_THREADS_WINDOWS) 99 CRITICAL_SECTION w_cs;
101 #elif defined(GECODE_THREADS_OSX_UNFAIR) 104 os_unfair_lock unfair_lck;
105 #pragma clang diagnostic push 106 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 108 #pragma clang diagnostic pop 110 #elif defined(GECODE_THREADS_PTHREADS) 114 #error No suitable mutex implementation found 128 static void*
operator new(
size_t s);
130 static void operator delete(
void*
p);
135 void operator=(
const Mutex&) {}
138 #ifndef GECODE_THREADS_PTHREADS_SPINLOCK 161 pthread_spinlock_t p_s;
174 static void*
operator new(
size_t s);
176 static void operator delete(
void*
p);
181 void operator=(
const FastMutex&) {}
204 void operator=(
const Lock&) {}
217 #ifdef GECODE_THREADS_WINDOWS 221 #ifdef GECODE_THREADS_PTHREADS 242 void operator=(
const Event&) {}
256 virtual void terminated(
void) = 0;
272 void todelete(
bool d);
274 bool todelete(
void)
const;
278 virtual void run(
void) = 0;
282 static void*
operator new(
size_t s);
284 static void operator delete(
void*
p);
316 static void*
operator new(
size_t s);
318 static void operator delete(
void*
p);
336 static void sleep(
unsigned int ms);
338 static unsigned int npu(
void);
343 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.
virtual ~Terminator()
Destructor.
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.
virtual Terminator * terminator(void) const
Return terminator object.
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.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
#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.
An interface for objects that can be called after a thread has terminated (after running the thread's...
Gecode toplevel namespace