mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Merge remote-tracking branch 'tonokip/master'
This commit is contained in:
commit
241c94cbdd
22
compat.h
22
compat.h
@ -47,16 +47,18 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reported unneded in https://github.com/veox/sgminer/issues/37 */
|
#if defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR
|
||||||
/* static inline int sleep(unsigned int secs) */
|
// Reported unneded in https://github.com/veox/sgminer/issues/37 */
|
||||||
/* { */
|
static inline int sleep(unsigned int secs)
|
||||||
/* struct timespec req, rem; */
|
{
|
||||||
/* req.tv_sec = secs; */
|
struct timespec req, rem;
|
||||||
/* req.tv_nsec = 0; */
|
req.tv_sec = secs;
|
||||||
/* if (!nanosleep(&req, &rem)) */
|
req.tv_nsec = 0;
|
||||||
/* return 0; */
|
if (!nanosleep(&req, &rem))
|
||||||
/* return rem.tv_sec + (rem.tv_nsec ? 1 : 0); */
|
return 0;
|
||||||
/* } */
|
return rem.tv_sec + (rem.tv_nsec ? 1 : 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PRIO_PROCESS = 0,
|
PRIO_PROCESS = 0,
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#else
|
#else
|
||||||
|
#include <winsock2.h> //before windows.h to resolve ws2tcpip.h conflict https://github.com/veox/sgminer/issues/12
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <ccan/opt/opt.h>
|
#include <ccan/opt/opt.h>
|
||||||
@ -3043,7 +3044,7 @@ static void kill_mining(void)
|
|||||||
if (thr && PTH(thr) != 0L)
|
if (thr && PTH(thr) != 0L)
|
||||||
pth = &thr->pth;
|
pth = &thr->pth;
|
||||||
thr_info_cancel(thr);
|
thr_info_cancel(thr);
|
||||||
#ifndef WIN32
|
#if !defined WIN32 || defined __MINGW64_VERSION_MAJOR
|
||||||
if (pth && *pth)
|
if (pth && *pth)
|
||||||
pthread_join(*pth, NULL);
|
pthread_join(*pth, NULL);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user