user2771729
user2771729

Reputation: 458

Attempt to use a deleted function

From what I can gather online the cause of this is most likely related to trying to copy a thread (which you can't do). I'm not sure why this problem is arising though. I do suspect which lines it arises in though.

Worker thread definition:

void WorkerThread(SharedLList<uint32_t> *workQueue, std::mutex *dataLock, uint8_t *data, uint32_t *seenStates, int depth)

Code in calling function:

SharedLList<uint32_t> workQueue;
std::mutex lock;
uint8_t *stateDepths = new uint8_t[s.GetMaxRank()];
uint32_t seenStates = 1;
int currDepth = 0;

    for (int i = 0; i < numThreads; i++)
    {
        threads[i] = new std::thread(WorkerThread, std::ref(workQueue), std::ref(lock), stateDepths, std::ref(seenStates), currDepth);
    }

Thread -> Semantic Issue -> Attempt to use a deleted function

This is the line:

   __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);

How can I fix this issue? What is wrong with my code?

Upvotes: 0

Views: 3701

Answers (1)

AnT stands with Russia
AnT stands with Russia

Reputation: 320381

Your thread function is declared as accepting pointers as parameters. Yet you pass references as arguments. This mismatch exists for all pointer parameters except uint8_t *data.

Upvotes: 1

Related Questions