[ECOS] a problem with thread

shobhan shobana@in.ceeyes.com
Mon Dec 3 20:28:00 GMT 2001


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



More information about the Ecos-discuss mailing list