startThreadPool() & joinThreadPool() APIs

3,365 views
Skip to first unread message

krr_android

unread,
Jul 9, 2009, 5:00:17 AM7/9/09
to android-ndk
Q: What is the meaning of the last two lines in the following method?

D:\SDKs\siso android source\src\frameworks\base\media\mediaserver
\main_mediaserver.cpp

int main(int argc, char** argv)
{
sp<ProcessState> proc(ProcessState::self());
sp<IServiceManager> sm = defaultServiceManager();
LOGI("ServiceManager: %p", sm.get());

AudioFlinger::instantiate();
MediaPlayerService::instantiate();
CameraService::instantiate();

ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();
}

Pls help me in understanding it. Is there any document explaining the
same?

Thanks in advance,

夢の翔

unread,
Jul 9, 2009, 6:54:05 AM7/9/09
to andro...@googlegroups.com
Seems to be to start the thread pool, and hang waiting for services


2009/7/9 krr_android <k.raj...@gmail.com>



--
by Guilh

Gmail : <gui...@gmail.com>
GTalk : <gui...@gmail.com>
MSN : <gui...@hotmail.com>
Skype : <guilh98>

Dianne Hackborn

unread,
Jul 9, 2009, 1:23:00 PM7/9/09
to andro...@googlegroups.com
Yes the first call starts the Binder thread pool for that process, the second put the calling into the thread pool to serve incoming transactions.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Reply all
Reply to author
Forward
0 new messages