6 #include "NThreadData.h"
29 NLogTrace(
"Processing coordinates in thread %llu",
30 (
unsigned long long)std::hash<std::thread::id>{}(std::this_thread::get_id()));
37 for (
int val : coords) {
40 std::this_thread::sleep_for(std::chrono::milliseconds(500));
45 NLogTrace(
"NThreadData [Index: %zu, ThreadId: %llu, Items: %lld, Sum: %lld]",
fAssignedIndex,
Thread-local data object for NDMSPC processing.
bool fIdSet
Flag to indicate if the thread ID is set.
size_t fAssignedIndex
Index assigned to this object.
virtual ~NThreadData()
Virtual destructor.
long long fCoordSum
Sum of coordinates.
virtual void Print(Option_t *option="") const
Print method override.
std::thread::id fThreadId
Thread ID.
virtual void Process(const std::vector< int > &coords)
Process method for thread data.
NThreadData()
Default constructor.
long long fItemCount
Number of items processed.
static std::mutex fSharedMutex
Shared mutex for thread-safe operations.