mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
4 years ago
|
/**
|
||
8 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
8 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
8 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
8 years ago
|
*
|
||
|
*/
|
||
|
|
||
|
/******************************************************************************
|
||
|
* File: tti_synch_cv.h
|
||
|
* Description: Implements tti_sync interface with condition variables.
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_TTI_SYNC_CV_H
|
||
|
#define SRSRAN_TTI_SYNC_CV_H
|
||
8 years ago
|
|
||
4 years ago
|
#include "srsran/common/tti_sync.h"
|
||
5 years ago
|
#include <pthread.h>
|
||
8 years ago
|
|
||
4 years ago
|
namespace srsran {
|
||
5 years ago
|
|
||
8 years ago
|
class tti_sync_cv : public tti_sync
|
||
|
{
|
||
5 years ago
|
public:
|
||
|
tti_sync_cv(uint32_t modulus = 10240);
|
||
|
~tti_sync_cv();
|
||
|
void increase();
|
||
|
void increase(uint32_t cnt);
|
||
|
uint32_t wait();
|
||
|
void resync();
|
||
|
void set_producer_cntr(uint32_t producer_cntr);
|
||
|
|
||
|
private:
|
||
|
pthread_cond_t cond;
|
||
|
pthread_mutex_t mutex;
|
||
|
};
|
||
8 years ago
|
|
||
4 years ago
|
} // namespace srsran
|
||
8 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_TTI_SYNC_CV_H
|