[Full source code](https://onlinegdb.com/ByZ_s3T1BB)

If I pass mutex object to `worker()` without reference, it causes compile error.

```
void worker(int& p_counter, std::mutex p_mutex) {
    ...
}

=============================================================================

workers.push_back(std::thread(worker, std::ref(counter), mutex));

```

But if I pass it with reference, it is compiled well.

```
void worker(int& p_counter, std::mutex& p_mutex) {
    ...
}

=============================================================================

workers.push_back(std::thread(worker, std::ref(counter), std::ref(mutex)));

```

Why is mutex implemented to be passed to functions using references?