diff --git a/NEWS b/NEWS index 32a1b0f19..33b74132c 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,9 @@ New in spot 2.10.6.dev (not yet released) Library: + - A global variable, together with its setters and getters to define the + maximal number of threads is added to common.hh/common.cc + - The new function suffix_operator_normal_form() implements transformation of formulas to Suffix Operator Normal Form, described in [cimatti.06.fmcad]. diff --git a/spot/Makefile.am b/spot/Makefile.am index 821979f1d..c7bebfe6a 100644 --- a/spot/Makefile.am +++ b/spot/Makefile.am @@ -35,7 +35,7 @@ SUBDIRS = misc priv tl graph twa twacube twaalgos ta taalgos kripke \ lib_LTLIBRARIES = libspot.la libspot_la_SOURCES = -libspot_la_LDFLAGS = $(BUDDY_LDFLAGS) -no-undefined $(SYMBOLIC_LDFLAGS) +libspot_la_LDFLAGS = $(BUDDY_LDFLAGS) -no-undefined -pthread $(SYMBOLIC_LDFLAGS) libspot_la_LIBADD = \ kripke/libkripke.la \ misc/libmisc.la \ diff --git a/spot/misc/Makefile.am b/spot/misc/Makefile.am index e509dbe87..623a13c87 100644 --- a/spot/misc/Makefile.am +++ b/spot/misc/Makefile.am @@ -63,6 +63,7 @@ libmisc_la_SOURCES = \ bareword.cc \ bitset.cc \ bitvect.cc \ + common.cc \ escape.cc \ formater.cc \ intvcomp.cc \ diff --git a/spot/misc/common.cc b/spot/misc/common.cc new file mode 100644 index 000000000..adf9f2da0 --- /dev/null +++ b/spot/misc/common.cc @@ -0,0 +1,33 @@ +// -*- coding: utf-8 -*- +// Copyright (C) 2018 Laboratoire de Recherche et Développement +// de l'Epita (LRDE). +// +// This file is part of Spot, a model checking library. +// +// Spot is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. +// +// Spot is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "config.h" +#include + +static unsigned N_MAX_THREADS = 1; + +void set_nthreads(unsigned nthreads) +{ + N_MAX_THREADS = nthreads; +} + +unsigned get_nthreads() +{ + return N_MAX_THREADS; +} \ No newline at end of file diff --git a/spot/misc/common.hh b/spot/misc/common.hh index e38f9f15a..fc74a8ee7 100644 --- a/spot/misc/common.hh +++ b/spot/misc/common.hh @@ -169,3 +169,11 @@ namespace spot # define SPOT_make_shared_enabled__(TYPE, ...) \ std::make_shared(__VA_ARGS__) #endif + + +// Global variable to determine the maximal number of threads +SPOT_API void +set_nthreads(unsigned nthreads); + +SPOT_API unsigned +get_nthreads();