BLooper: API to hijack existing thread.
I need this to use loopers in WebKit, which spawns threads and expects to be able to turn them into event loops later on. This is the pattern already used in BApplication, we may as well make it available elsewhere. Change-Id: I5939ca89d33cb3bcc92567b302c2038d976af598 Reviewed-on: https://review.haiku-os.org/735 Reviewed-by: Axel Dörfler <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
4bba0571c6
commit
151343ebc8
@@ -590,15 +590,7 @@ BApplication::Run()
|
||||
if (fInitError != B_OK)
|
||||
return fInitError;
|
||||
|
||||
AssertLocked();
|
||||
|
||||
if (fRunCalled)
|
||||
debugger("BApplication::Run was already called. Can only be called once.");
|
||||
|
||||
fThread = find_thread(NULL);
|
||||
fRunCalled = true;
|
||||
|
||||
task_looper();
|
||||
Loop();
|
||||
|
||||
delete fPulseRunner;
|
||||
return fThread;
|
||||
|
||||
Reference in New Issue
Block a user