Visual C++ (componentwork++):
My worker thread:
UINT GetDataThreadProc(LPVOID lParam)
{
	double value;
	
	double Data[100];
        CMyDlg *pWnd = (CMyDlg *)lParam; 
 
	
	
	
	::WaitForSingleObject(g_eventStart.m_hObject, INFINITE);
    TRACE("starting computation\n");
    while(g_iBeginGetDataProc)
	{
			for (int ptIndex = 0; ptIndex < 100; ptIndex++)
		{
			const double maxValue = 10.0;
			value = (double)rand()/RAND_MAX * maxValue;
			Data[ptIndex] = value;
	
			TRACE (" %d  %f\n", ptIndex, Data[ptIndex]);
		}
		TRACE ("Ok\n");
	//---------------------------------------------------
-----------------------
    //  plot the time domain data
    //--------------------------------------------------------------------------
	pWnd->m_timeDomainGraph.PlotY(CNiReal64Matrix(1, 100, Data));
	
		
		if (::WaitForSingleObject(g_eventKill.m_hObject, 0) == WAIT_OBJECT_0)
		{
			TRACE ("Break\n");
			break;
		}
  
	}
    // tell owner window we're finished
	::PostMessage((HWND) lParam, WM_THREADFINISHED, 0, 0);
   
     return 0; // ends the thread
}