Lines Matching refs:thiz
29 IObject *thiz = (IObject *) self; in HandleRealize() local
30 assert(NULL != thiz); in HandleRealize()
31 const ClassTable *clazz = thiz->mClass; in HandleRealize()
38 object_lock_exclusive(thiz); in HandleRealize()
39 state = thiz->mState; in HandleRealize()
44 thiz->mState = SL_OBJECT_STATE_REALIZING_2; in HandleRealize()
47 result = (*realize)(thiz, SL_BOOLEAN_TRUE); in HandleRealize()
48 assert(SL_OBJECT_STATE_REALIZING_2 == thiz->mState); in HandleRealize()
70 thiz->mState = state; in HandleRealize()
73 slObjectCallback callback = thiz->mCallback; in HandleRealize()
74 void *context = thiz->mContext; in HandleRealize()
75 object_unlock_exclusive(thiz); in HandleRealize()
79 (*callback)(&thiz->mItf, context, SL_OBJECT_EVENT_ASYNC_TERMINATION, result, state, NULL); in HandleRealize()
88 IObject *thiz = (IObject *) self; in IObject_Realize() local
90 const ClassTable *clazz = thiz->mClass; in IObject_Realize()
92 object_lock_exclusive(thiz); in IObject_Realize()
102 state = thiz->mState; in IObject_Realize()
105 object_unlock_exclusive(thiz); in IObject_Realize()
120 thiz->mState = state; in IObject_Realize()
123 object_unlock_exclusive(thiz); in IObject_Realize()
125 result = ThreadPool_add_ppi(&thiz->mEngine->mThreadPool, HandleRealize, thiz, NULL, 0); in IObject_Realize()
128 object_lock_exclusive(thiz); in IObject_Realize()
129 thiz->mState = SL_OBJECT_STATE_UNREALIZED; in IObject_Realize()
130 object_unlock_exclusive(thiz); in IObject_Realize()
138 result = (NULL != realize) ? (*realize)(thiz, async) : SL_RESULT_SUCCESS; in IObject_Realize()
139 assert(SL_OBJECT_STATE_REALIZING_2 == thiz->mState); in IObject_Realize()
142 thiz->mState = state; in IObject_Realize()
143 slObjectCallback callback = thiz->mCallback; in IObject_Realize()
144 void *context = thiz->mContext; in IObject_Realize()
145 object_unlock_exclusive(thiz); in IObject_Realize()
149 (*callback)(&thiz->mItf, context, SL_OBJECT_EVENT_ASYNC_TERMINATION, result, state, in IObject_Realize()
155 object_unlock_exclusive(thiz); in IObject_Realize()
172 IObject *thiz = (IObject *) self; in HandleResume() local
173 assert(NULL != thiz); in HandleResume()
174 const ClassTable *clazz = thiz->mClass; in HandleResume()
181 object_lock_exclusive(thiz); in HandleResume()
182 state = thiz->mState; in HandleResume()
187 thiz->mState = SL_OBJECT_STATE_RESUMING_2; in HandleResume()
190 result = (*resume)(thiz, SL_BOOLEAN_TRUE); in HandleResume()
191 assert(SL_OBJECT_STATE_RESUMING_2 == thiz->mState); in HandleResume()
213 thiz->mState = state; in HandleResume()
216 slObjectCallback callback = thiz->mCallback; in HandleResume()
217 void *context = thiz->mContext; in HandleResume()
218 object_unlock_exclusive(thiz); in HandleResume()
222 (*callback)(&thiz->mItf, context, SL_OBJECT_EVENT_ASYNC_TERMINATION, result, state, NULL); in HandleResume()
231 IObject *thiz = (IObject *) self; in IObject_Resume() local
232 const ClassTable *clazz = thiz->mClass; in IObject_Resume()
234 object_lock_exclusive(thiz); in IObject_Resume()
235 state = thiz->mState; in IObject_Resume()
238 object_unlock_exclusive(thiz); in IObject_Resume()
248 thiz->mState = state; in IObject_Resume()
251 object_unlock_exclusive(thiz); in IObject_Resume()
253 result = ThreadPool_add_ppi(&thiz->mEngine->mThreadPool, HandleResume, thiz, NULL, 0); in IObject_Resume()
256 object_lock_exclusive(thiz); in IObject_Resume()
257 thiz->mState = SL_OBJECT_STATE_SUSPENDED; in IObject_Resume()
258 object_unlock_exclusive(thiz); in IObject_Resume()
266 result = (NULL != resume) ? (*resume)(thiz, SL_BOOLEAN_FALSE) : SL_RESULT_SUCCESS; in IObject_Resume()
267 assert(SL_OBJECT_STATE_RESUMING_2 == thiz->mState); in IObject_Resume()
268 thiz->mState = (SL_RESULT_SUCCESS == result) ? SL_OBJECT_STATE_REALIZED : in IObject_Resume()
270 object_unlock_exclusive(thiz); in IObject_Resume()
274 object_unlock_exclusive(thiz); in IObject_Resume()
291 IObject *thiz = (IObject *) self; in IObject_GetState() local
292 object_lock_shared(thiz); in IObject_GetState()
293 SLuint8 state = thiz->mState; in IObject_GetState()
294 object_unlock_shared(thiz); in IObject_GetState()
336 IObject *thiz = (IObject *) self; in IObject_GetInterface() local
337 const ClassTable *clazz = thiz->mClass; in IObject_GetInterface()
346 object_lock_exclusive(thiz); in IObject_GetInterface()
347 if ((SL_OBJECT_STATE_REALIZED != thiz->mState) && in IObject_GetInterface()
352 clazz->mSLObjectID) && (1 == ((CAudioPlayer *) thiz)->mNumChannels)) { in IObject_GetInterface()
357 switch (thiz->mInterfaceStates[index]) { in IObject_GetInterface()
360 interface = (char *) thiz + clazz->mInterfaces[index].mOffset; in IObject_GetInterface()
363 if (!(thiz->mGottenMask & mask)) { in IObject_GetInterface()
364 thiz->mGottenMask |= mask; in IObject_GetInterface()
377 object_unlock_exclusive(thiz); in IObject_GetInterface()
392 IObject *thiz = (IObject *) self; in IObject_RegisterCallback() local
393 object_lock_exclusive(thiz); in IObject_RegisterCallback()
394 thiz->mCallback = callback; in IObject_RegisterCallback()
395 thiz->mContext = pContext; in IObject_RegisterCallback()
396 object_unlock_exclusive(thiz); in IObject_RegisterCallback()
407 static void Abort_internal(IObject *thiz) in Abort_internal() argument
409 const ClassTable *clazz = thiz->mClass; in Abort_internal()
411 object_lock_exclusive(thiz); in Abort_internal()
414 switch (thiz->mState) { in Abort_internal()
416 thiz->mState = SL_OBJECT_STATE_REALIZING_1A; in Abort_internal()
420 thiz->mState = SL_OBJECT_STATE_RESUMING_1A; in Abort_internal()
437 SLuint8 *interfaceStateP = thiz->mInterfaceStates; in Abort_internal()
463 object_unlock_exclusive(thiz); in Abort_internal()
467 object_lock_exclusive(thiz); in Abort_internal()
468 switch (thiz->mState) { in Abort_internal()
483 interfaceStateP = thiz->mInterfaceStates; in Abort_internal()
509 IObject *thiz = (IObject *) self; in IObject_AbortAsyncOperation() local
510 Abort_internal(thiz); in IObject_AbortAsyncOperation()
511 object_unlock_exclusive(thiz); in IObject_AbortAsyncOperation()
521 IObject *thiz = (IObject *) self; in IObject_Destroy() local
523 Abort_internal(thiz); in IObject_Destroy()
525 const ClassTable *clazz = thiz->mClass; in IObject_Destroy()
531 predestroy_t okToDestroy = (*preDestroy)(thiz); in IObject_Destroy()
536 SL_LOGE("Object::Destroy(%p) not allowed", thiz); in IObject_Destroy()
539 object_unlock_exclusive(thiz); in IObject_Destroy()
548 thiz->mState = SL_OBJECT_STATE_DESTROYING; in IObject_Destroy()
551 IEngine *thisEngine = &thiz->mEngine->mEngine; in IObject_Destroy()
552 unsigned i = thiz->mInstanceID; in IObject_Destroy()
555 if (thisEngine->mThis != thiz) { in IObject_Destroy()
567 assert(thisEngine->mInstances[i] == thiz); in IObject_Destroy()
571 if (thisEngine->mThis != thiz) { in IObject_Destroy()
576 (*destroy)(thiz); in IObject_Destroy()
584 SLuint8 *interfaceStateP = &thiz->mInterfaceStates[index]; in IObject_Destroy()
588 void *thisItf = (char *) thiz + offset; in IObject_Destroy()
622 SL_LOGE("Object::Destroy(%p) while interface %u active", thiz, index); in IObject_Destroy()
630 memset(thiz, 0x55, clazz->mSize); // catch broken applications that continue using interfaces in IObject_Destroy()
633 CEngine_Destroyed((CEngine *) thiz); in IObject_Destroy()
635 free(thiz); in IObject_Destroy()
646 IObject *thiz = (IObject *) self; in IObject_SetPriority() local
647 object_lock_exclusive(thiz); in IObject_SetPriority()
648 thiz->mPriority = priority; in IObject_SetPriority()
649 thiz->mPreemptable = SL_BOOLEAN_FALSE != preemptable; // normalize in IObject_SetPriority()
650 object_unlock_exclusive(thiz); in IObject_SetPriority()
668 IObject *thiz = (IObject *) self; in IObject_GetPriority() local
669 object_lock_shared(thiz); in IObject_GetPriority()
670 SLint32 priority = thiz->mPriority; in IObject_GetPriority()
671 SLboolean preemptable = thiz->mPreemptable; in IObject_GetPriority()
672 object_unlock_shared(thiz); in IObject_GetPriority()
697 IObject *thiz = (IObject *) self; in IObject_SetLossOfControlInterfaces() local
698 const ClassTable *clazz = thiz->mClass; in IObject_SetLossOfControlInterfaces()
716 object_lock_exclusive(thiz); in IObject_SetLossOfControlInterfaces()
718 thiz->mLossOfControlMask |= lossOfControlMask; in IObject_SetLossOfControlInterfaces()
720 thiz->mLossOfControlMask &= ~lossOfControlMask; in IObject_SetLossOfControlInterfaces()
722 object_unlock_exclusive(thiz); in IObject_SetLossOfControlInterfaces()
752 IObject *thiz = (IObject *) self; in IObject_init() local
753 thiz->mItf = &IObject_Itf; in IObject_init()
760 thiz->mState = SL_OBJECT_STATE_UNREALIZED; in IObject_init()
761 thiz->mGottenMask = 1; // IObject in IObject_init()
762 thiz->mAttributesMask = 0; in IObject_init()
763 thiz->mCallback = NULL; in IObject_init()
764 thiz->mContext = NULL; in IObject_init()
766 thiz->mPriority = SL_PRIORITY_NORMAL; in IObject_init()
767 thiz->mPreemptable = SL_BOOLEAN_FALSE; in IObject_init()
769 thiz->mStrongRefCount = 0; in IObject_init()
771 ok = pthread_mutex_init(&thiz->mMutex, (const pthread_mutexattr_t *) NULL); in IObject_init()
774 memset(&thiz->mOwner, 0, sizeof(pthread_t)); in IObject_init()
775 thiz->mFile = NULL; in IObject_init()
776 thiz->mLine = 0; in IObject_init()
777 thiz->mGeneration = 0; in IObject_init()
779 ok = pthread_cond_init(&thiz->mCond, (const pthread_condattr_t *) NULL); in IObject_init()
788 IObject *thiz = (IObject *) self; in IObject_deinit() local
790 assert(pthread_equal(pthread_self(), thiz->mOwner)); in IObject_deinit()
793 ok = pthread_cond_destroy(&thiz->mCond); in IObject_deinit()
796 ok = pthread_mutex_unlock(&thiz->mMutex); in IObject_deinit()
798 ok = pthread_mutex_destroy(&thiz->mMutex); in IObject_deinit()
809 void IObject_Publish(IObject *thiz) in IObject_Publish() argument
811 IEngine *thisEngine = &thiz->mEngine->mEngine; in IObject_Publish()
819 thisEngine->mInstances[i] = thiz; in IObject_Publish()
822 thiz->mInstanceID = i + 1; in IObject_Publish()