Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Wait for other Threads
icon5.gif  Wait for other Threads [message #46568] Wed, 01 June 2016 17:25 Go to previous message
funky1221 is currently offline  funky1221
Messages: 3
Registered: May 2016
Junior Member
My code as following. Compiled OK but when I run the program and push button
to search file, No response and like crashed.

Someone help to solve this issue ???


void testU::PushRun()
{
	grid1.Clear();
	intfile=0;
	Thread().Run(THISBACK1(Searchfile,"C:"));
	Thread().Run(THISBACK1(Searchfile,"E:"));
	
	
	while(Thread().GetCount());
		
	String s = "Total " + AsString(intfile) + " Files";
	PromptOK(s);
}
void testU::Searchfile(String path)
{
	
	FindFile fs;
	String file = edit;
	file = path + "\\" + file;
	if(fs.Search(file))
	{

		do
		{
			Time t(fs.GetLastWriteTime());
		    String lstime = Format("%",t);
			String fullname = fs.GetPath();
			INTERLOCKED{
			  grid1.Add(fullname,lstime);
			  intfile++;
			}
			
		}while(fs.Next());
	}
	
}
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to use the TcpSocket::Get?
Next Topic: skylark meet strange problem
Goto Forum:
  


Current Time: Tue Jun 11 12:31:15 CEST 2024

Total time taken to generate the page: 0.01999 seconds