www.digitalmars.com         C & C++   DMDScript  

D - wait()

reply "Phill" <phill pacific.net.au> writes:
Can somebody please tell me why the Thread in
this class will not wait when requested?
-----------------------------
class painter : Thread {


void start(){
 run(this);
  }

void run(void* p){

  theCanvas.penColor(200,200,100);

  for(int i = 0; i < 14; i++){
    printf("ticking");
    wait(1000);
    theCanvas.line(158,158, dot[i][0], dot[i][1]);
    }

  }

}
------------------------------
I have done this wrong, but what is
the correct way?

Phill.
Feb 05 2004
parent reply "Walter" <walter digitalmars.com> writes:
Are you running linux or windows?

"Phill" <phill pacific.net.au> wrote in message
news:bvsuv5$1k8p$1 digitaldaemon.com...
 Can somebody please tell me why the Thread in
 this class will not wait when requested?
 -----------------------------
 class painter : Thread {


 void start(){
  run(this);
   }

 void run(void* p){

   theCanvas.penColor(200,200,100);

   for(int i = 0; i < 14; i++){
     printf("ticking");
     wait(1000);
     theCanvas.line(158,158, dot[i][0], dot[i][1]);
     }

   }

 }
 ------------------------------
 I have done this wrong, but what is
 the correct way?

 Phill.
Feb 05 2004
parent reply "Phill" <phill pacific.net.au> writes:
WindowsXP


"Walter" <walter digitalmars.com> wrote in message
news:bvv2cq$20ca$1 digitaldaemon.com...
 Are you running linux or windows?

 "Phill" <phill pacific.net.au> wrote in message
 news:bvsuv5$1k8p$1 digitaldaemon.com...
 Can somebody please tell me why the Thread in
 this class will not wait when requested?
 -----------------------------
 class painter : Thread {


 void start(){
  run(this);
   }

 void run(void* p){

   theCanvas.penColor(200,200,100);

   for(int i = 0; i < 14; i++){
     printf("ticking");
     wait(1000);
     theCanvas.line(158,158, dot[i][0], dot[i][1]);
     }

   }

 }
 ------------------------------
 I have done this wrong, but what is
 the correct way?

 Phill.
Feb 05 2004
parent reply "Walter" <walter digitalmars.com> writes:
Take a look at the source to std.thread.wait(). Maybe put a printf in there
and see what's happening.

"Phill" <phill pacific.net.au> wrote in message
news:bvv2ge$20j1$1 digitaldaemon.com...
 WindowsXP


 "Walter" <walter digitalmars.com> wrote in message
 news:bvv2cq$20ca$1 digitaldaemon.com...
 Are you running linux or windows?

 "Phill" <phill pacific.net.au> wrote in message
 news:bvsuv5$1k8p$1 digitaldaemon.com...
 Can somebody please tell me why the Thread in
 this class will not wait when requested?
 -----------------------------
 class painter : Thread {


 void start(){
  run(this);
   }

 void run(void* p){

   theCanvas.penColor(200,200,100);

   for(int i = 0; i < 14; i++){
     printf("ticking");
     wait(1000);
     theCanvas.line(158,158, dot[i][0], dot[i][1]);
     }

   }

 }
 ------------------------------
 I have done this wrong, but what is
 the correct way?

 Phill.
Feb 05 2004
parent reply "Phill" <phill pacific.net.au> writes:
I dont know of a way to do this(rebuild phobos)
 because I dont have a FAT32 file sys, I have NTFS
and apparently there is another  file called "SC"
on  my PC that is being called instead of your
"SC".   I think it is somthing to do with the NT
file sys.
I am correct is assuming that I would have to
rebuild phobos?

Phill.

 "Walter" <walter digitalmars.com> wrote in message
news:bvv7mn$2a1m$1 digitaldaemon.com...
 Take a look at the source to std.thread.wait(). Maybe put a printf in
there
 and see what's happening.

 "Phill" <phill pacific.net.au> wrote in message
 news:bvv2ge$20j1$1 digitaldaemon.com...
 WindowsXP


 "Walter" <walter digitalmars.com> wrote in message
 news:bvv2cq$20ca$1 digitaldaemon.com...
 Are you running linux or windows?

 "Phill" <phill pacific.net.au> wrote in message
 news:bvsuv5$1k8p$1 digitaldaemon.com...
 Can somebody please tell me why the Thread in
 this class will not wait when requested?
 -----------------------------
 class painter : Thread {


 void start(){
  run(this);
   }

 void run(void* p){

   theCanvas.penColor(200,200,100);

   for(int i = 0; i < 14; i++){
     printf("ticking");
     wait(1000);
     theCanvas.line(158,158, dot[i][0], dot[i][1]);
     }

   }

 }
 ------------------------------
 I have done this wrong, but what is
 the correct way?

 Phill.
Feb 07 2004
parent reply J C Calvarese <jcc7 cox.net> writes:
Phill wrote:
 I dont know of a way to do this(rebuild phobos)
  because I dont have a FAT32 file sys, I have NTFS
 and apparently there is another  file called "SC"
 on  my PC that is being called instead of your
 "SC".   I think it is somthing to do with the NT
 file sys.
I doubt it's a FAT vs NTFS issue, anything is possible. My suspicion is that need to adjust your path. Have you checked your path yet? Since you're on XP, I won't bother talking about "autoexec.bat". Right-click on "My Computer". Click on "Properties". Click on the "Advanced" tab. Click on the "Environment Variables". In the "System variables" frame, there should be an entry called "Path". Put c:\dm\bin;c:\dmd\bin; at the front of the list and see if the right SC is found. I don't know if this will help you, but it solved my problem with my computer running the wrong make in the past. (My apologies for being useful and condescending if you've already done this. :) ) By the way, I've had various problems rebuilding phobos, too. I've succeeded once or twice, but the other times -- well, I got frustrated and gave up. I guess I need to be more stubborn.
 I am correct is assuming that I would have to
 rebuild phobos?
Yep.
 
 Phill.
-- Justin http://jcc_7.tripod.com/d/
Feb 06 2004
next sibling parent "Phill" <phill pacific.net.au> writes:
It states it in the error that it is an NT process or similar. Anyway:
I thought of that, but I didnt want to do it because
im not sure what the other SC is for and I didnt
want dm's SC to be called to do the task's of the
other(if you know what I mean).
So I changed the partition back to FAT32
and reformatted my HD.
I will try to rebuild phobos later tonight.

If anyone else out there, has XP on a NTFS
are  you able rebuilt phobos on your sys?

I would definetely prefer a NTFS system.

Thanks
          Phill.

"J C Calvarese" <jcc7 cox.net> wrote in message
news:c021d0$11up$1 digitaldaemon.com...
 Phill wrote:
 I dont know of a way to do this(rebuild phobos)
  because I dont have a FAT32 file sys, I have NTFS
 and apparently there is another  file called "SC"
 on  my PC that is being called instead of your
 "SC".   I think it is somthing to do with the NT
 file sys.
I doubt it's a FAT vs NTFS issue, anything is possible. My suspicion is that need to adjust your path. Have you checked your path yet? Since you're on XP, I won't bother talking about "autoexec.bat". Right-click on "My Computer". Click on "Properties". Click on the "Advanced" tab. Click on the "Environment Variables". In the "System variables" frame, there should be an entry called "Path". Put c:\dm\bin;c:\dmd\bin; at the front of the list and see if the right SC is found. I don't know if this will help you, but it solved my problem with my computer running the wrong make in the past. (My apologies for being useful and condescending if you've already done this. :) ) By the way, I've had various problems rebuilding phobos, too. I've succeeded once or twice, but the other times -- well, I got frustrated and gave up. I guess I need to be more stubborn.
 I am correct is assuming that I would have to
 rebuild phobos?
Yep.
 Phill.
-- Justin http://jcc_7.tripod.com/d/
Feb 07 2004
prev sibling parent "Phill" <phill pacific.net.au> writes:
FYI this  is what the other SC is:
-------------------------------------------
SC
Communicates with the Service Controller and installed services. SC.exe
retrieves and sets control information about services. You can use SC.exe
for testing and debugging service programs. Service properties stored in the
registry can be set to control how service applications are started at boot
time and run as background processes. SC.exe parameters can configure a
specific service, retrieve the current status of a service, as well as stop
and start a service. You can create batch files that call various SC.exe
commands to automate the startup or shutdown sequence of services. SC.exe
provides capabilities similar to Services in the Administrative Tools item
in Control Panel.

------------------------------------

Thanks

           Phill.

"J C Calvarese" <jcc7 cox.net> wrote in message
news:c021d0$11up$1 digitaldaemon.com...
 Phill wrote:
 I dont know of a way to do this(rebuild phobos)
  because I dont have a FAT32 file sys, I have NTFS
 and apparently there is another  file called "SC"
 on  my PC that is being called instead of your
 "SC".   I think it is somthing to do with the NT
 file sys.
I doubt it's a FAT vs NTFS issue, anything is possible. My suspicion is that need to adjust your path. Have you checked your path yet? Since you're on XP, I won't bother talking about "autoexec.bat". Right-click on "My Computer". Click on "Properties". Click on the "Advanced" tab. Click on the "Environment Variables". In the "System variables" frame, there should be an entry called "Path". Put c:\dm\bin;c:\dmd\bin; at the front of the list and see if the right SC is found. I don't know if this will help you, but it solved my problem with my computer running the wrong make in the past. (My apologies for being useful and condescending if you've already done this. :) ) By the way, I've had various problems rebuilding phobos, too. I've succeeded once or twice, but the other times -- well, I got frustrated and gave up. I guess I need to be more stubborn.
 I am correct is assuming that I would have to
 rebuild phobos?
Yep.
 Phill.
-- Justin http://jcc_7.tripod.com/d/
Feb 07 2004