Skip to content

Commit 301f920

Browse files
committed
Thread: Drop string pool thread tracking
1 parent 5faf1d0 commit 301f920

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

include/scratchcpp/thread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class LIBSCRATCHCPP_EXPORT Thread
2020
public:
2121
Thread(Target *target, IEngine *engine, Script *script);
2222
Thread(const Thread &) = delete;
23-
~Thread();
2423

2524
Target *target() const;
2625
IEngine *engine() const;

src/engine/thread.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
#include <scratchcpp/executioncontext.h>
77

88
#include "thread_p.h"
9-
#include "scratch/string_pool_p.h"
109

1110
using namespace libscratchcpp;
1211

1312
/*! Constructs Thread. */
1413
Thread::Thread(Target *target, IEngine *engine, Script *script) :
1514
impl(spimpl::make_unique_impl<ThreadPrivate>(target, engine, script))
1615
{
17-
string_pool_add_thread(this);
18-
1916
if (impl->script) {
2017
impl->code = impl->script->code();
2118
impl->hatPredicateCode = impl->script->hatPredicateCode();
@@ -28,12 +25,6 @@ Thread::Thread(Target *target, IEngine *engine, Script *script) :
2825
}
2926
}
3027

31-
/*! Destroys Thread. */
32-
Thread::~Thread()
33-
{
34-
string_pool_remove_thread(this);
35-
}
36-
3728
/*! Returns the Target of the script. */
3829
Target *Thread::target() const
3930
{
@@ -55,17 +46,13 @@ Script *Thread::script() const
5546
/*! Runs the script until it finishes or yields. */
5647
void Thread::run()
5748
{
58-
string_pool_set_thread(this);
5949
impl->code->run(impl->executionContext.get());
60-
string_pool_set_thread(nullptr);
6150
}
6251

6352
/*! Runs the reporter and returns its return value. */
6453
ValueData Thread::runReporter()
6554
{
66-
string_pool_set_thread(this);
6755
ValueData ret = impl->code->runReporter(impl->executionContext.get());
68-
string_pool_set_thread(nullptr);
6956
return ret;
7057
}
7158

@@ -75,9 +62,7 @@ bool Thread::runPredicate()
7562
if (!impl->hatPredicateCode)
7663
return false;
7764

78-
string_pool_set_thread(this);
7965
const bool ret = impl->hatPredicateCode->runPredicate(impl->hatPredicateExecutionContext.get());
80-
string_pool_set_thread(nullptr);
8166
return ret;
8267
}
8368

0 commit comments

Comments
 (0)