diff dmd2/root/async.c @ 1526:54b3c1394d62

Merged dmdfe 2.031.
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 07 Jul 2009 02:26:11 +0100
parents 638d16625da2
children
line wrap: on
line diff
--- a/dmd2/root/async.c	Mon Jul 06 23:57:27 2009 +0100
+++ b/dmd2/root/async.c	Tue Jul 07 02:26:11 2009 +0100
@@ -61,21 +61,25 @@
 
 void AsyncRead::start()
 {
-    unsigned threadaddr;
-    hThread = (HANDLE) _beginthreadex(NULL,
-	0,
-	&startthread,
-	this,
-	0,
-	(unsigned *)&threadaddr);
+    //printf("aw->filesdim = %p %d\n", this, filesdim);
+    if (filesdim)
+    {
+	unsigned threadaddr;
+	hThread = (HANDLE) _beginthreadex(NULL,
+	    0,
+	    &startthread,
+	    this,
+	    0,
+	    (unsigned *)&threadaddr);
 
-    if (hThread)
-    {
-	SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
-    }
-    else
-    {
-	assert(0);
+	if (hThread)
+	{
+	    SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
+	}
+	else
+	{
+	    assert(0);
+	}
     }
 }
 
@@ -98,6 +102,7 @@
 {
     AsyncRead *aw = (AsyncRead *)p;
 
+    //printf("aw->filesdim = %p %d\n", aw, aw->filesdim);
     for (size_t i = 0; i < aw->filesdim; i++)
     {	FileData *f = &aw->files[i];