kernel/eka/kernel/skernel.cpp
changeset 134 95847726fe57
parent 90 947f0dc9f7a8
child 177 a232af6b0b1f
equal deleted inserted replaced
133:2a0ada0a1bf8 134:95847726fe57
    51 	}
    51 	}
    52 
    52 
    53 // Enter and return with system unlocked.
    53 // Enter and return with system unlocked.
    54 TInt DSemaphore::Create(DObject* aOwner, const TDesC* aName, TInt aInitialCount, TBool aVisible)
    54 TInt DSemaphore::Create(DObject* aOwner, const TDesC* aName, TInt aInitialCount, TBool aVisible)
    55 	{
    55 	{
    56 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DSemaphore::Create owner %O, name %lS, init count=%d, visible=%d",aOwner,aName,aInitialCount,aVisible));
    56 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DSemaphore::Create owner %O, name %S, init count=%d, visible=%d",aOwner,aName,aInitialCount,aVisible));
    57 	if (aInitialCount<0)
    57 	if (aInitialCount<0)
    58 		return KErrArgument;
    58 		return KErrArgument;
    59 	SetOwner(aOwner);
    59 	SetOwner(aOwner);
    60 	TInt r=KErrNone;
    60 	TInt r=KErrNone;
    61 	if (aName && aName->Length())
    61 	if (aName && aName->Length())
   304 	}
   304 	}
   305 
   305 
   306 // Enter and return with system unlocked.
   306 // Enter and return with system unlocked.
   307 TInt DMutex::Create(DObject* aOwner, const TDesC* aName, TBool aVisible, TUint aOrder)
   307 TInt DMutex::Create(DObject* aOwner, const TDesC* aName, TBool aVisible, TUint aOrder)
   308 	{
   308 	{
   309 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DMutex::Create owner %O, name %lS, visible=%d, order=%02x",aOwner,aName,aVisible,aOrder));
   309 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DMutex::Create owner %O, name %S, visible=%d, order=%02x",aOwner,aName,aVisible,aOrder));
   310 	iOrder = (TUint8)aOrder;
   310 	iOrder = (TUint8)aOrder;
   311 	SetOwner(aOwner);
   311 	SetOwner(aOwner);
   312 	TInt r=KErrNone;
   312 	TInt r=KErrNone;
   313 	if (aName && aName->Length())
   313 	if (aName && aName->Length())
   314 		{
   314 		{
   652 	}
   652 	}
   653 
   653 
   654 // Enter and return with system unlocked.
   654 // Enter and return with system unlocked.
   655 TInt DCondVar::Create(DObject* aOwner, const TDesC* aName, TBool aVisible)
   655 TInt DCondVar::Create(DObject* aOwner, const TDesC* aName, TBool aVisible)
   656 	{
   656 	{
   657 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DCondVar::Create owner %O, name %lS, visible=%d",aOwner,aName,aVisible));
   657 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DCondVar::Create owner %O, name %S, visible=%d",aOwner,aName,aVisible));
   658 	SetOwner(aOwner);
   658 	SetOwner(aOwner);
   659 	TInt r=KErrNone;
   659 	TInt r=KErrNone;
   660 	if (aName && aName->Length())
   660 	if (aName && aName->Length())
   661 		{
   661 		{
   662 		r=SetName(aName);
   662 		r=SetName(aName);
  1078 	const TDesC* pN=NULL;
  1078 	const TDesC* pN=NULL;
  1079 	if (aName)
  1079 	if (aName)
  1080 		{
  1080 		{
  1081 		Kern::KUDesGet(n,*aName);
  1081 		Kern::KUDesGet(n,*aName);
  1082 		pN=&n;
  1082 		pN=&n;
       
  1083 		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::CondVarCreate %S", pN));
  1083 		}
  1084 		}
  1084 	else if (aType==EOwnerThread)
  1085 	else if (aType==EOwnerThread)
  1085 		pO=TheCurrentThread;
  1086 		pO=TheCurrentThread;
  1086 	else
  1087 	else
  1087 		pO=TheCurrentThread->iOwningProcess;
  1088 		pO=TheCurrentThread->iOwningProcess;
  1088 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::CondVarCreate %lS", aName));
       
  1089 	NKern::ThreadEnterCS();
  1089 	NKern::ThreadEnterCS();
  1090 	TInt r=KErrNoMemory;
  1090 	TInt r=KErrNoMemory;
  1091 	DCondVar* pV = new DCondVar;
  1091 	DCondVar* pV = new DCondVar;
  1092 	if (pV)
  1092 	if (pV)
  1093 		{
  1093 		{