Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 480b4680 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Shorten thread names

prctl(PR_SET_NAME) limits to 15 characters.  Before we had names like
"Binder Thread #" and the counter was cut off :-( Also remove redundant
"thread" at end of name; it's always a thread.

Change-Id: I1f99c2730ba0787ed9b59c15914356cddf698e2f
parent a3873833
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ status_t AudioRecord::start()
        pid_t tid;
        if (t != 0) {
            mReadyToRun = WOULD_BLOCK;
            t->run("ClientRecordThread", ANDROID_PRIORITY_AUDIO);
            t->run("AudioRecord", ANDROID_PRIORITY_AUDIO);
            tid = t->getTid();  // pid_t is unknown until run()
            ALOGV("getTid=%d", tid);
            if (tid == -1) {
+1 −1
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ void AudioTrack::start()
        android_atomic_and(~CBLK_DISABLED_ON, &cblk->flags);
        pid_t tid;
        if (t != 0) {
            t->run("AudioTrackThread", ANDROID_PRIORITY_AUDIO);
            t->run("AudioTrack", ANDROID_PRIORITY_AUDIO);
            tid = t->getTid();  // pid_t is unknown until run()
            ALOGV("getTid=%d", tid);
            if (tid == -1) {
+2 −2
Original line number Diff line number Diff line
@@ -1464,7 +1464,7 @@ AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinge
        mMasterVolume(audioFlinger->masterVolumeSW_l()),
        mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false)
{
    snprintf(mName, kNameLength, "AudioOut_%d", id);
    snprintf(mName, kNameLength, "AudioOut_%X", id);

    readOutputParameters();

@@ -4791,7 +4791,7 @@ AudioFlinger::RecordThread::RecordThread(const sp<AudioFlinger>& audioFlinger,
    // mBytesRead is only meaningful while active, and so is cleared in start()
    // (but might be better to also clear here for dump?)
{
    snprintf(mName, kNameLength, "AudioIn_%d", id);
    snprintf(mName, kNameLength, "AudioIn_%X", id);

    readInputParameters();
}
+1 −1
Original line number Diff line number Diff line
@@ -548,7 +548,7 @@ private:
                    Vector< sp<EffectChain> > mEffectChains;
                    uint32_t                mDevice;    // output device for PlaybackThread
                                                        // input + output devices for RecordThread
                    static const int        kNameLength = 32;
                    static const int        kNameLength = 16;   // prctl(PR_SET_NAME) limit
                    char                    mName[kNameLength];
                    sp<IPowerManager>       mPowerManager;
                    sp<IBinder>             mWakeLockToken;
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ AudioPolicyService::AudioPolicyService()
    // start tone playback thread
    mTonePlaybackThread = new AudioCommandThread(String8(""));
    // start audio commands thread
    mAudioCommandThread = new AudioCommandThread(String8("ApmCommandThread"));
    mAudioCommandThread = new AudioCommandThread(String8("ApmCommand"));

    /* instantiate the audio policy manager */
    rc = hw_get_module(AUDIO_POLICY_HARDWARE_MODULE_ID, &module);
@@ -638,7 +638,7 @@ void AudioPolicyService::AudioCommandThread::onFirstRef()
    if (mName != "") {
        run(mName.string(), ANDROID_PRIORITY_AUDIO);
    } else {
        run("AudioCommandThread", ANDROID_PRIORITY_AUDIO);
        run("AudioCommand", ANDROID_PRIORITY_AUDIO);
    }
}