<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dcpomatic/src/lib/encode_server_finder.cc, branch v2.16.18</title>
<subtitle>DCP-o-matic DCP tools</subtitle>
<id>https://git.carlh.net/cgit/dcpomatic/atom?h=v2.16.18</id>
<link rel='self' href='https://git.carlh.net/cgit/dcpomatic/atom?h=v2.16.18'/>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/'/>
<updated>2022-02-25T07:00:51Z</updated>
<entry>
<title>Avoid boost::bind()ing a shared_ptr.</title>
<updated>2022-02-25T07:00:51Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2022-02-22T19:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=b2c412480aa2cc29bfbb90556f974e9294608898'/>
<id>urn:sha1:b2c412480aa2cc29bfbb90556f974e9294608898</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix some dubious thread/locking behaviour.</title>
<updated>2022-02-25T07:00:51Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2022-02-24T18:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=5ec4efca61906608e2e7a590b3d1c3f2b7078e81'/>
<id>urn:sha1:5ec4efca61906608e2e7a590b3d1c3f2b7078e81</id>
<content type='text'>
Previously we had server_found(), which took the lock and found
a server, which it returned as an iterator into the list.
However, it then released the lock, which I think left the
iterator unprotected.

This wasn't done in response to any particular bug, I just
noticed it on the way past.
</content>
</entry>
<entry>
<title>C++11 tidying.</title>
<updated>2021-05-03T18:18:04Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-05-03T09:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=689fa55d1529ad88449ca464e9107c4dcc54d1cb'/>
<id>urn:sha1:689fa55d1529ad88449ca464e9107c4dcc54d1cb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add some possibly-useful markers for debugging threads from coredumps.</title>
<updated>2021-04-20T22:52:07Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-04-20T10:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=c370c651eba466f5073384de8b304a2625c64b89'/>
<id>urn:sha1:c370c651eba466f5073384de8b304a2625c64b89</id>
<content type='text'>
</content>
</entry>
<entry>
<title>BOOST_FOREACH.</title>
<updated>2021-01-07T22:27:56Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-01-04T20:32:13Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=a5d004b0773f633401528392fc28e66d70e13ac8'/>
<id>urn:sha1:a5d004b0773f633401528392fc28e66d70e13ac8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std::shared_ptr</title>
<updated>2021-01-07T21:48:29Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-01-04T20:16:53Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26'/>
<id>urn:sha1:dd9be86db6cde0afa5da0d1d1ac43b42e05dca26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>If we don't query a server (because we already know about it)</title>
<updated>2020-11-26T01:24:32Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-11-26T01:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=dfb23c675ca145b5570ccb5790ea804ad736a247'/>
<id>urn:sha1:dfb23c675ca145b5570ccb5790ea804ad736a247</id>
<content type='text'>
the "last seen time" will never be updated, so the server will
be discarded.

It seems that we should always ping servers (so that set_seen gets
called on receipt of the response), no matter whether
"auto-discovered" or configured, so that the "discard" code doesn't
kick in.

Otherwise we remove and re-add our configured servers every
10 seconds, which is inefficient and which possibly triggers
other bugs.
</content>
</entry>
<entry>
<title>Use a foreach.</title>
<updated>2020-11-26T00:49:19Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-11-26T00:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=6e5dec71bf4e7a5ff81ecc115c04e8ec2b540c67'/>
<id>urn:sha1:6e5dec71bf4e7a5ff81ecc115c04e8ec2b540c67</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Build fixes for Boost &gt;= 1.73</title>
<updated>2020-09-01T14:34:26Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-08-27T20:37:32Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=c04fec82d25127fafa73c3daff87bece9aa8c8e8'/>
<id>urn:sha1:c04fec82d25127fafa73c3daff87bece9aa8c8e8</id>
<content type='text'>
Forward-ported-from: d1e9749ca290673639a49d693a8fe5c6557cc2de
</content>
</entry>
<entry>
<title>Fix bugs in thread termination causing occasional pthread</title>
<updated>2020-07-29T18:22:54Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-07-29T18:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=e3c7656f9dc0acbaf518c051b847ee2e4eb7ba23'/>
<id>urn:sha1:e3c7656f9dc0acbaf518c051b847ee2e4eb7ba23</id>
<content type='text'>
assertion failures.

Before this, it was possible for J2KEncoder::terminate_threads()
to finish without terminating all threads if the thread _running_
terminate_threads() was itself interrupt()ed.

This is because the thread_group::join_all() in terminate_threads()
is an interruption point, so it was possible it not to complete
but instead to throw interrupted_exception.  Then the owning
J2KEncoder would be torn down but the threads would still be running,
causing use-after-frees.

This commit adds some boost::this_thread::disable_interruption
objects to ensure that the owning thread is not interrupted while
it is being destroyed.

Also tidy up code that does this stuff, assuming that it's safe
to not call thread::joinable but instead do

thread.interrupt();
try {
  thread.join();
} catch (...) {}
</content>
</entry>
</feed>
