48 */ |
48 */ |
49 |
49 |
50 GLDEF_C TInt E32Main() |
50 GLDEF_C TInt E32Main() |
51 { |
51 { |
52 |
52 |
53 RDebug::Print(_L("New process starting")); |
53 RDebug::Print(_L("STIF: New process starting")); |
54 |
54 |
55 // Get module name from command line |
55 // Get module name from command line |
56 const TInt length = User().CommandLineLength(); |
56 const TInt length = User().CommandLineLength(); |
57 |
57 |
58 HBufC* cmdLine = HBufC::New( length ); |
58 HBufC* cmdLine = HBufC::New( length ); |
64 |
64 |
65 TPtr moduleName = cmdLine->Des(); |
65 TPtr moduleName = cmdLine->Des(); |
66 |
66 |
67 User().CommandLine( moduleName ); |
67 User().CommandLine( moduleName ); |
68 |
68 |
69 RDebug::Print (moduleName); |
69 RDebug::Print(_L("STIF: Received data [%S]"), &moduleName); |
|
70 |
|
71 // Extract semaphore name passed in data |
|
72 TInt index = moduleName.Find(_L(" ")); |
|
73 RDebug::Print(_L("STIF: Space separator found at position [%d]"), index); |
|
74 TPtrC semaphoreName = moduleName.Mid(index + 1); |
|
75 moduleName = moduleName.Left(index); |
|
76 |
|
77 RDebug::Print(_L("STIF: Extracted module name [%S] and sempahore name [%S]"), &moduleName, &semaphoreName); |
70 |
78 |
71 // Open start-up synchronization semaphore |
79 // Open start-up synchronization semaphore |
72 RSemaphore startup; |
80 RSemaphore startup; |
73 RDebug::Print(_L(" Openingstart-up semaphore")); |
81 RDebug::Print(_L(" Openingstart-up semaphore")); |
74 TName semaphoreName = _L("startupSemaphore"); |
82 //TName semaphoreName = _L("startupSemaphore"); |
75 semaphoreName.Append( moduleName ); |
83 //semaphoreName.Append( moduleName ); |
76 |
84 |
77 TInt res = startup.OpenGlobal(semaphoreName); |
85 TInt res = startup.OpenGlobal(semaphoreName); |
78 RDebug::Print(_L("Opening result %d"), res); |
86 RDebug::Print(_L("Opening result %d"), res); |
79 |
87 |
80 |
88 |