Print

Print


FYI, you can ignore this, I fixed it :)


On 05/07/2015 10:08 PM, Jacek Becla wrote:
> All:
>
> I am trying to migrate from boost threads
> to std threads, the code is in tickets/DM-2711
>
> I did standard renames plus a couple of tweaks,
> but things are hanging, and this is the code
> I am having problem with:
>
>
> +void
> +WorkQueue::_startRunner(WorkQueue& wq) {
> +    Runner(wq)();
> +}
> +
>   void
>   WorkQueue::_addRunner() {
>       std::unique_lock<std::mutex> lock(_runnersMutex);
> -    boost::thread(Runner(*this));
> +    std::thread t(_startRunner, std::ref(*this));
> +    t.detach();
>       _runnerRegistered.wait(lock);
>   }
>
> The problem is that the thread does not start, and things
> deadlock because registerRunner should be called inside
> that thread, and it should unblock this:
> _runnerRegistered.wait(lock);
> but it is not happening.
>
> We spent quite a bit of time with John trying to get that
> piece of code to work, and clearly we didn't get it right.
>
> Any suggestions anyone?
>
> Jacek

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the QSERV-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1