Merge "Remove global variables from ProcessState."
This commit is contained in:
commit
033bdd72f9
@ -27,11 +27,6 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
namespace android {
|
||||
|
||||
// Global variables
|
||||
extern int mArgC;
|
||||
extern const char* const* mArgV;
|
||||
extern int mArgLen;
|
||||
|
||||
class IPCThreadState;
|
||||
|
||||
class ProcessState : public virtual RefBase
|
||||
@ -62,12 +57,6 @@ public:
|
||||
wp<IBinder> getWeakProxyForHandle(int32_t handle);
|
||||
void expungeHandle(int32_t handle, IBinder* binder);
|
||||
|
||||
void setArgs(int argc, const char* const argv[]);
|
||||
int getArgC() const;
|
||||
const char* const* getArgV() const;
|
||||
|
||||
void setArgV0(const char* txt);
|
||||
|
||||
void spawnPooledThread(bool isMain);
|
||||
|
||||
status_t setThreadPoolMaxThreadCount(size_t maxThreads);
|
||||
|
@ -48,11 +48,6 @@
|
||||
|
||||
namespace android {
|
||||
|
||||
// Global variables
|
||||
int mArgC;
|
||||
const char* const* mArgV;
|
||||
int mArgLen;
|
||||
|
||||
class PoolThread : public Thread
|
||||
{
|
||||
public:
|
||||
@ -280,36 +275,6 @@ void ProcessState::expungeHandle(int32_t handle, IBinder* binder)
|
||||
if (e && e->binder == binder) e->binder = NULL;
|
||||
}
|
||||
|
||||
void ProcessState::setArgs(int argc, const char* const argv[])
|
||||
{
|
||||
mArgC = argc;
|
||||
mArgV = (const char **)argv;
|
||||
|
||||
mArgLen = 0;
|
||||
for (int i=0; i<argc; i++) {
|
||||
mArgLen += strlen(argv[i]) + 1;
|
||||
}
|
||||
mArgLen--;
|
||||
}
|
||||
|
||||
int ProcessState::getArgC() const
|
||||
{
|
||||
return mArgC;
|
||||
}
|
||||
|
||||
const char* const* ProcessState::getArgV() const
|
||||
{
|
||||
return mArgV;
|
||||
}
|
||||
|
||||
void ProcessState::setArgV0(const char* txt)
|
||||
{
|
||||
if (mArgV != NULL) {
|
||||
strncpy((char*)mArgV[0], txt, mArgLen);
|
||||
set_process_name(txt);
|
||||
}
|
||||
}
|
||||
|
||||
String8 ProcessState::makeBinderThreadName() {
|
||||
int32_t s = android_atomic_add(1, &mThreadPoolSeq);
|
||||
String8 name;
|
||||
|
Loading…
Reference in New Issue
Block a user