kernel/eka/kernel/sexec.cpp
branchRCL_3
changeset 298 2024e52ac966
parent 294 039a3e647356
equal deleted inserted replaced
295:5460f47b94ad 298:2024e52ac966
   936 
   936 
   937 
   937 
   938 
   938 
   939 TInt ExecHandler::OpenObject(TObjectType aObjType, const TDesC8& aName, TOwnerType aType)
   939 TInt ExecHandler::OpenObject(TObjectType aObjType, const TDesC8& aName, TOwnerType aType)
   940 	{
   940 	{
   941 	__KTRACE_OPT(KTHREAD,Kern::Printf("Exec::OpenObject %lS",&aName));
       
   942 	TFullName n;
   941 	TFullName n;
   943 	Kern::KUDesGet(n,aName);
   942 	Kern::KUDesGet(n,aName);
       
   943 	__KTRACE_OPT(KTHREAD,Kern::Printf("Exec::OpenObject %lS",&n));
   944 	if (Kern::ValidateFullName(n)!=KErrNone)
   944 	if (Kern::ValidateFullName(n)!=KErrNone)
   945 		K::PanicKernExec(EBadName);
   945 		K::PanicKernExec(EBadName);
   946 	if ((TUint)aObjType>=(TUint)ENumObjectTypes)
   946 	if ((TUint)aObjType>=(TUint)ENumObjectTypes)
   947 		K::PanicKernExec(EBadObjectType);
   947 		K::PanicKernExec(EBadObjectType);
   948 	TInt h=0;
   948 	TInt h=0;
  1010 	const TDesC* pN=NULL;
  1010 	const TDesC* pN=NULL;
  1011 	if (aName)
  1011 	if (aName)
  1012 		{
  1012 		{
  1013 		Kern::KUDesGet(n,*aName);
  1013 		Kern::KUDesGet(n,*aName);
  1014 		pN=&n;
  1014 		pN=&n;
       
  1015 		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::MutexCreate %lS",pN));
  1015 		}
  1016 		}
  1016 	else if (aType==EOwnerThread)
  1017 	else if (aType==EOwnerThread)
  1017 		pO=TheCurrentThread;
  1018 		pO=TheCurrentThread;
  1018 	else
  1019 	else
  1019 		pO=TheCurrentThread->iOwningProcess;
  1020 		pO=TheCurrentThread->iOwningProcess;
  1020 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::MutexCreate %lS",aName));
       
  1021 	NKern::ThreadEnterCS();
  1021 	NKern::ThreadEnterCS();
  1022 	DMutex* pM;
  1022 	DMutex* pM;
  1023 	TInt r=K::MutexCreate(pM, *pN, pO, ETrue, KMutexOrdUser);
  1023 	TInt r=K::MutexCreate(pM, *pN, pO, ETrue, KMutexOrdUser);
  1024 	if (r==KErrNone)
  1024 	if (r==KErrNone)
  1025 		{
  1025 		{
  1034 	return r;
  1034 	return r;
  1035 	}
  1035 	}
  1036 
  1036 
  1037 TInt ExecHandler::SemaphoreCreate(const TDesC8* aName, TInt aCount, TOwnerType aType)
  1037 TInt ExecHandler::SemaphoreCreate(const TDesC8* aName, TInt aCount, TOwnerType aType)
  1038 	{
  1038 	{
  1039 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::SemaphoreCreate %lS",aName));
       
  1040 	TKName n;
  1039 	TKName n;
  1041 	DObject* pO=NULL;
  1040 	DObject* pO=NULL;
  1042 	const TDesC* pN=NULL;
  1041 	const TDesC* pN=NULL;
  1043 	if (aName)
  1042 	if (aName)
  1044 		{
  1043 		{
  1045 		Kern::KUDesGet(n,*aName);
  1044 		Kern::KUDesGet(n,*aName);
  1046 		pN=&n;
  1045 		pN=&n;
       
  1046 		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::SemaphoreCreate %lS",pN));
  1047 		}
  1047 		}
  1048 	else if (aType==EOwnerThread)
  1048 	else if (aType==EOwnerThread)
  1049 		pO=TheCurrentThread;
  1049 		pO=TheCurrentThread;
  1050 	else
  1050 	else
  1051 		pO=TheCurrentThread->iOwningProcess;
  1051 		pO=TheCurrentThread->iOwningProcess;