This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a problem with thread


Hi,
Following is my test case

cyg_handle_t  flowThreadId;
cyg_thread          flowThread;
char      flowThreadStack[4096];

void flowInit ( void )
{
cyg_thread_create(4, flowThreadEntryPoint, (cyg_addrword_t) 0,
      "Flow thread", (void *) flowThreadStack, (4096*2),
      &flowThreadId, &flowThread);
}

Follwoing is the Thread Entry Point:

void flowThreadEntryPoint ( void )
{
 uint8_t     *pucBuf;    /* Buffer holding received from message queue  */
 struct flowPkt   * flowBuffer;
 uint8_t     * tmpFlowBuf;
 cluster_t          *pCluster=NULL;

 while ( 1 )
 {

  pCluster = ws_getFirstCluster ( );
  if ( !pCluster )
  {
#ifdef  FLOW_DEBUG
   printf(" \nNo cluster Configured discarding packet ");
#endif
   cyg_thread_delay( 100 );
   continue;
  }
   /*
   *  Receive pascket from message queue
   */
  tmpFlowBuf = cyg_mbox_get(flowMsgBoxHandle);
  flowBuffer = ( struct flowPkt *)tmpFlowBuf;

  if( flowBuffer->buffer == NULL )
  {
   cmss_printf("\r\n Before freeing Memory in flowmgr ");
   L64324_FreeBuffer ( flowBuffer->globalPktIndex);
            continue;
  }
 // cmss_printf("\r\n Before forwarding the flow the ParsePacket ");
  parsePacket ( flowBuffer->buffer ,flowBuffer->globalPktIndex );

 }
}

In Thread entry poing i simply forward the buffer to parsePacket routine....


I could not figure out where the mistake is...

Thanks in Advance

Shobhan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]