mirror of
https://github.com/GOSTSec/ccminer
synced 2025-08-26 22:02:08 +00:00
applog: remove useless mutex
This commit is contained in:
parent
9a13624c2e
commit
bcbb959a34
5
compat.h
5
compat.h
@ -4,8 +4,9 @@
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
extern int opt_priority;
|
#define localtime_r(src, dst) localtime_s(dst, src)
|
||||||
|
|
||||||
static __inline void sleep(int secs)
|
static __inline void sleep(int secs)
|
||||||
{
|
{
|
||||||
@ -16,6 +17,8 @@ enum {
|
|||||||
PRIO_PROCESS = 0,
|
PRIO_PROCESS = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int opt_priority;
|
||||||
|
|
||||||
static __inline int setpriority(int which, int who, int prio)
|
static __inline int setpriority(int which, int who, int prio)
|
||||||
{
|
{
|
||||||
switch (opt_priority) {
|
switch (opt_priority) {
|
||||||
|
7
util.cpp
7
util.cpp
@ -105,13 +105,10 @@ void applog(int prio, const char *fmt, ...)
|
|||||||
const char* color = "";
|
const char* color = "";
|
||||||
char *f;
|
char *f;
|
||||||
int len;
|
int len;
|
||||||
struct tm tm, *tm_p;
|
struct tm tm;
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
|
|
||||||
pthread_mutex_lock(&applog_lock);
|
localtime_r(&now, &tm);
|
||||||
tm_p = localtime(&now);
|
|
||||||
memcpy(&tm, tm_p, sizeof(tm));
|
|
||||||
pthread_mutex_unlock(&applog_lock);
|
|
||||||
|
|
||||||
switch (prio) {
|
switch (prio) {
|
||||||
case LOG_ERR: color = CL_RED; break;
|
case LOG_ERR: color = CL_RED; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user