Hi,
I created a thread using pthread_create call with proper ID,attributes etc.
Also I tried executing the system() function before and after the creation of this thread.The system() function call before the thread creation is executed perfectly.But the one after the thread creation hangs indefinitely. The thread that I have created is a for timer task and it runs infinitely. Once the timer(child) thread is up and running, the system() function call in the parent thread hangs.
I am presenting the code snippet here,
173 pthread_mutex_lock (&(pTsk->TskMutex));/* Create the qnx thread. */
174 system("echo \"**************174********************\"");
175 if (pthread_create (&(pTsk->ThrId), &Attr, OsixTskWrapper, (void *) pTsk))
176 {
177 pthread_mutex_unlock (&(pTsk->TskMutex));
178
179 pthread_mutex_destroy (&(pTsk->TskMutex));
180 pthread_mutex_destroy (&(pTsk->EvtMutex));
181 pthread_cond_destroy (&(pTsk->EvtCond));
182
183 OsixRscDel (OSIX_TSK, u4Idx);
184 return (OSIX_FAILURE);
185 }
186
187 /* The OSIX task has been fully created. Now let the thread run. */
188 pthread_mutex_unlock (&(pTsk->TskMutex));
189 system("echo \"**************189********************\"");
The process hangs at line number 189.
Please guide me on this. Why system function call is hanging ?