MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / start

Method start

core/core_bind.cpp:1521–1537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1519}
1520
1521Error Thread::start(const Callable &p_callable, Priority p_priority) {
1522 ERR_FAIL_COND_V_MSG(is_started(), ERR_ALREADY_IN_USE, "Thread already started.");
1523 ERR_FAIL_COND_V(!p_callable.is_valid(), ERR_INVALID_PARAMETER);
1524 ERR_FAIL_INDEX_V(p_priority, PRIORITY_MAX, ERR_INVALID_PARAMETER);
1525
1526 ret = Variant();
1527 target_callable = p_callable;
1528 running.set();
1529
1530 Ref<Thread> *ud = memnew(Ref<Thread>(this));
1531
1532 ::Thread::Settings s;
1533 s.priority = (::Thread::Priority)p_priority;
1534 thread.start(_start_func, ud, s);
1535
1536 return OK;
1537}
1538
1539String Thread::get_id() const {
1540 return itos(thread.get_id());

Callers 5

mainFunction · 0.45
test_timer.hFile · 0.45
testMethod · 0.45
init_threadsMethod · 0.45

Calls 3

VariantClass · 0.50
is_validMethod · 0.45
setMethod · 0.45

Tested by 3

mainFunction · 0.36
testMethod · 0.36
init_threadsMethod · 0.36