Skip to content
Snippets Groups Projects
Commit bf113123 authored by rswindell's avatar rswindell
Browse files

Added yield function to reduce DOS program CPU hogging.

parent e1225389
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ __declspec(dllexport) void __cdecl VDDDispatch(void)
static RingBuf rdbuf;
static FILE* fp;
retval=0;
node_num=getBH();
switch(getBL()) {
......@@ -280,7 +281,6 @@ __declspec(dllexport) void __cdecl VDDDispatch(void)
retval=0;
break;
#if 1
case VDD_INBUF_FULL:
if(!GetMailslotInfo(
rdslot, // mailslot handle
......@@ -338,7 +338,11 @@ __declspec(dllexport) void __cdecl VDDDispatch(void)
retval=1;
online_poll++;
break;
#endif
case VDD_YIELD:
Sleep(1);
break;
default:
if(fp!=NULL)
fprintf(fp,"!UNKNOWN VDD_OP: %d\r\n",getBL());
......
......@@ -50,6 +50,7 @@ enum {
,VDD_OUTBUF_FULL
,VDD_OUTBUF_SIZE
,VDD_ONLINE
,VDD_YIELD
};
typedef struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment