static double Time_F(int s)
{
+ double ret;
+ static HANDLE thr;
+
if (s == START)
{
- HANDLE thr;
schlock = 0;
thr = CreateThread(NULL,4096,sleepy,NULL,0,NULL);
if (thr==NULL)
BIO_printf(bio_err,"unable to CreateThread (%d)",ret);
ExitProcess(ret);
}
- CloseHandle(thr); /* detach the thread */
while (!schlock) Sleep(0); /* scheduler spinlock */
+ ret = app_tminterval(s,usertime);
+ }
+ else
+ {
+ ret = app_tminterval(s,usertime);
+ if (run) TerminateThread(thr,0);
+ CloseHandle(thr);
}
- return app_tminterval(s,usertime);
+ return ret;
}
#else
static double Time_F(int s)
{
- return app_tminterval(s,usertime);
+ double ret = app_tminterval(s,usertime);
+ if (s == STOP) alarm(0);
+ return ret;
}
#endif
# error "You cannot disable DES on systems without SIGALRM."
#endif /* OPENSSL_NO_DES */
#else
-#define COND(c) (run)
+#define COND(c) (run && count<0x7fffffff)
#define COUNT(d) (count)
#ifndef _WIN32
signal(SIGALRM,sig_done);