Skip to content

Commit 0128869

Browse files
committed
Fix thread-local variables to use cross-platform Boost version
1 parent 427fc78 commit 0128869

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/mapnik_python.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
3030
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
3131
#include "python_to_value.hpp"
32+
#include <boost/thread/tss.hpp>
3233
#include <boost/python/args.hpp> // for keywords, arg, etc
3334
#include <boost/python/converter/from_python.hpp>
3435
#include <boost/python/def.hpp> // for def
@@ -190,7 +191,7 @@ using mapnik::python_unblock_auto_block;
190191
#ifdef MAPNIK_DEBUG
191192
bool python_thread::thread_support = true;
192193
#endif
193-
thread_local std::unique_ptr<PyThreadState> python_thread::state;
194+
boost::thread_specific_ptr<PyThreadState> python_thread::state;
194195

195196
struct agg_renderer_visitor_1
196197
{

src/mapnik_threads.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef MAPNIK_THREADS_HPP
2323
#define MAPNIK_THREADS_HPP
2424

25-
#include <thread>
25+
#include <boost/thread/tss.hpp>
2626
#include <Python.h>
2727

2828
namespace mapnik {
@@ -70,7 +70,7 @@ class python_thread
7070
}
7171

7272
private:
73-
static thread_local std::unique_ptr<PyThreadState> state;
73+
static boost::thread_specific_ptr<PyThreadState> state;
7474
#ifdef MAPNIK_DEBUG
7575
static bool thread_support;
7676
#endif

0 commit comments

Comments
 (0)