Commit 6f8b4f20 authored by mir's avatar mir

_Atomic and c++ ..

parent 9cc24478
......@@ -13,8 +13,16 @@
#include "task.h"
#ifndef __cplusplus
# include <stdatomic.h>
#else
# include <atomic>
# define _Atomic(X) std::atomic< X >
#endif
#include <pthread.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
......@@ -29,7 +37,7 @@
typedef struct{
uint8_t* buf;
size_t len;
_Atomic int* tasks_remaining;
_Atomic(int)* tasks_remaining;
} thread_info_tm_t;
typedef struct{
......@@ -37,18 +45,18 @@ typedef struct{
pthread_t* t_arr;
size_t len_thr;
atomic_uint_fast64_t index;
_Atomic(uint64_t) index;
void* q_arr;
atomic_uint_fast64_t num_task;
_Atomic(uint64_t) num_task;
pthread_cond_t wait_cv;
pthread_mutex_t wait_mtx;
_Atomic int32_t futex;
_Atomic(int32_t) futex;
_Atomic bool waiting;
_Atomic(bool) waiting;
} task_manager_t;
void init_task_manager(task_manager_t* man, uint32_t num_threads);
......
......@@ -67,7 +67,7 @@ typedef struct {
/// LDPC-code outputs
uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS];
#ifdef TASK_MANAGER_CODING
_Atomic int* task_done;
_Atomic(int)* task_done;
#endif
} encoder_implemparams_t;
......
......@@ -179,7 +179,7 @@ typedef struct {
int endSymbol;
int slot;
#ifdef TASK_MANAGER_RU
_Atomic int* task_done;
_Atomic(int)* task_done;
#endif
} feprx_cmd_t;
......@@ -190,7 +190,7 @@ typedef struct {
int startSymbol;
int numSymbols;
#ifdef TASK_MANAGER_RU
_Atomic int* task_done;
_Atomic(int)* task_done;
#endif
} feptx_cmd_t;
......
......@@ -791,7 +791,7 @@ typedef struct LDPCDecode_s {
int decodeIterations;
uint32_t tbslbrm;
#ifdef TASK_MANAGER
_Atomic int* tasks_remaining;
_Atomic(int)* tasks_remaining;
#endif
} ldpcDecode_t;
......
......@@ -32,12 +32,6 @@
#ifndef __PHY_DEFS_NR_UE__H__
#define __PHY_DEFS_NR_UE__H__
#ifdef __cplusplus
#include <atomic>
#define _Atomic(X) std::atomic< X >
#endif
#include "defs_nr_common.h"
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "common/utils/thread_pool/task_manager.h"
......@@ -687,7 +681,7 @@ typedef struct nr_rxtx_thread_data_s {
nr_phy_data_t phy_data;
int tx_wait_for_dlsch;
#ifdef TASK_MANAGER_UE_DECODING
_Atomic int* task_done;
_Atomic(int)* task_done;
#endif
} nr_rxtx_thread_data_t;
......@@ -716,7 +710,7 @@ typedef struct LDPCDecode_ue_s {
time_stats_t ts_ldpc_decode;
UE_nr_rxtx_proc_t *proc;
#ifdef TASK_MANAGER_UE_DECODING
_Atomic int* task_done;
_Atomic(int)* task_done;
#endif
} ldpcDecode_ue_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment