You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
633 B

#pragma once
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <sstream>
#include <string>
#include <vector>
namespace iflytop {
namespace core {
using namespace std;
class Singal {
atomic<int> signalNum = {0};
pthread_mutex_t m_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t m_cond;
pthread_condattr_t m_attr;
public:
Singal();
bool sleep_for_us(int64_t us);
bool sleep();
void notify();
};
} // namespace core
} // namespace iflytop