thread/Thread: use BoundMethod

This commit is contained in:
Max Kellermann
2017-02-10 22:41:11 +01:00
parent 5ba5bc8ba1
commit 781487c4dd
19 changed files with 94 additions and 124 deletions

View File

@@ -26,13 +26,10 @@
#endif
void
Thread::Start(void (*_f)(void *ctx), void *_ctx)
Thread::Start()
{
assert(!IsDefined());
f = _f;
ctx = _ctx;
#ifdef WIN32
handle = ::CreateThread(nullptr, 0, ThreadProc, this, 0, &id);
if (handle == nullptr)
@@ -87,7 +84,7 @@ Thread::Run()
#endif
#endif
f(ctx);
f();
#ifdef ANDROID
Java::DetachCurrentThread();