kernel/eka/kernel/object.cpp
branchRCL_3
changeset 43 c1f20ce4abcf
parent 0 a41df078684a
child 44 3e88ff8f41d5
equal deleted inserted replaced
42:a179b74831c9 43:c1f20ce4abcf
   439 	@internalComponent
   439 	@internalComponent
   440  */
   440  */
   441 EXPORT_C TInt DObject::SetName(const TDesC* aName)
   441 EXPORT_C TInt DObject::SetName(const TDesC* aName)
   442 	{
   442 	{
   443 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"DObject::SetName");		
   443 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"DObject::SetName");		
   444 	__KTRACE_OPT(KOBJECT,Kern::Printf("SetName %O (%lS)",this,aName));
   444 	__KTRACE_OPT(KOBJECT,Kern::Printf("SetName %O (%S)",this,aName));
   445 	TAny* pN=NULL;
   445 	TAny* pN=NULL;
   446 	if (aName)
   446 	if (aName)
   447 		{
   447 		{
   448 		TInt r = Kern::ValidateName(*aName);
   448 		TInt r = Kern::ValidateName(*aName);
   449 		if(r!=KErrNone)
   449 		if(r!=KErrNone)
   454 		}
   454 		}
   455 	NKern::FMWait(&Lock);
   455 	NKern::FMWait(&Lock);
   456 	pN = __e32_atomic_swp_ord_ptr(&iName, pN);
   456 	pN = __e32_atomic_swp_ord_ptr(&iName, pN);
   457 	if (iName)
   457 	if (iName)
   458 		{
   458 		{
   459 		__KTRACE_OPT(KOBJECT,Kern::Printf("Name is now %lS",iName));
   459 		__KTRACE_OPT(KOBJECT,Kern::Printf("Name is now %S",iName));
   460 		}
   460 		}
   461 	else
   461 	else
   462 		{
   462 		{
   463 		__KTRACE_OPT(KOBJECT,Kern::Printf("No name"));
   463 		__KTRACE_OPT(KOBJECT,Kern::Printf("No name"));
   464 		}
   464 		}
  1162 		if (r==KErrNone)
  1162 		if (r==KErrNone)
  1163 			{
  1163 			{
  1164 			__KTRACE_OPT(KOBJECT,Kern::Printf("Container %d created OK",pC->UniqueID()));
  1164 			__KTRACE_OPT(KOBJECT,Kern::Printf("Container %d created OK",pC->UniqueID()));
  1165 			return pC;
  1165 			return pC;
  1166 			}
  1166 			}
  1167 		__KTRACE_OPT(KOBJECT,Kern::Printf("Error %d creating mutex %lS",r,&n));
  1167 		__KTRACE_OPT(KOBJECT,Kern::Printf("Error %d creating mutex %S",r,&n));
  1168 		}
  1168 		}
  1169 	return NULL;
  1169 	return NULL;
  1170 	}
  1170 	}
  1171 
  1171 
  1172 /** Returns the kernel object containers array.
  1172 /** Returns the kernel object containers array.