3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 17:54:43 +00:00
z3/src/util/cooperate.h
Nikolaj Bjorner 4bc044c982 update header guards to be C++ style. Fixes issue #9
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-07-08 23:18:40 -07:00

50 lines
872 B
C++

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
cooperate.h
Abstract:
Cooperation support
Author:
Leonardo (leonardo) 2011-05-17
Notes:
--*/
#ifndef COOPERATE_H_
#define COOPERATE_H_
class cooperation_section;
class cooperation_ctx {
friend class cooperation_section;
static bool g_cooperate;
public:
static bool enabled() { return g_cooperate; }
static void checkpoint(char const * task);
};
inline void cooperate(char const * task) {
if (cooperation_ctx::enabled()) cooperation_ctx::checkpoint(task);
}
// must be declared before "#pragma parallel" to enable cooperation
class cooperation_section {
public:
cooperation_section();
~cooperation_section();
};
// must be first declaration inside "#pragma parallel for"
class init_task {
public:
init_task(char const * task);
~init_task();
};
#endif