コード例 #1
0
status_t BpBinder::linkToDeath(
    const sp<DeathRecipient>& recipient, void* cookie, uint32_t flags)
{
    Obituary ob;
    ob.recipient = recipient;
    ob.cookie = cookie;
    ob.flags = flags;

    LOG_ALWAYS_FATAL_IF(recipient == NULL,
                        "linkToDeath(): recipient must be non-NULL");

    {
        AutoMutex _l(mLock);

        if (!mObitsSent) {
            if (!mObituaries) {
                mObituaries = new Vector<Obituary>;
                if (!mObituaries) {
                    return NO_MEMORY;
                }
                ALOGV("Requesting death notification: %p handle %d\n", this, mHandle);
                getWeakRefs()->incWeak(this);
                IPCThreadState* self = IPCThreadState::self();
                self->requestDeathNotification(mHandle, this);
                self->flushCommands();
            }
            ssize_t res = mObituaries->add(ob);
            return res >= (ssize_t)NO_ERROR ? (status_t)NO_ERROR : res;
        }
    }

    return DEAD_OBJECT;
}
コード例 #2
0
ファイル: FFL_RefBase.hpp プロジェクト: lianhuaren/cocoa
         //! DEBUGGING ONLY: Enable tracking of object.
 inline  void            trackMe(bool enable, bool retain)
 {
     getWeakRefs()->trackMe(enable, retain);
 }
コード例 #3
0
ファイル: FFL_RefBase.hpp プロジェクト: lianhuaren/cocoa
         //! DEBUGGING ONLY: Print references held on object.
 inline  void            printRefs() const { getWeakRefs()->printRefs(); }