<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dcpomatic/src/lib/j2k_encoder.cc, branch disk-opt</title>
<subtitle>DCP-o-matic DCP tools</subtitle>
<id>https://git.carlh.net/cgit/dcpomatic/atom?h=disk-opt</id>
<link rel='self' href='https://git.carlh.net/cgit/dcpomatic/atom?h=disk-opt'/>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/'/>
<updated>2021-01-31T02:14:24Z</updated>
<entry>
<title>More enum class additions.</title>
<updated>2021-01-31T02:14:24Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-01-31T02:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8'/>
<id>urn:sha1:8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>More c++ tidying.</title>
<updated>2021-01-11T15:46:13Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2021-01-11T15:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=9b946fc5250eff5a5dd4a661896916fcd5d9bd4b'/>
<id>urn:sha1:9b946fc5250eff5a5dd4a661896916fcd5d9bd4b</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>Fix transcode finish time estimations when re-encoding a DCP (#1863).</title>
<updated>2020-12-05T19:24:18Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-12-05T19:24:18Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=a842e3bb5c9900ee14c02d8fcf0f614f32783b4b'/>
<id>urn:sha1:a842e3bb5c9900ee14c02d8fcf0f614f32783b4b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>It feels unsafe not to lock _threads_mutex between terminate_threads()</title>
<updated>2020-11-26T01:04:25Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-11-26T01:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=82fbf2b9e43fb234f843dc3352fecbd08eeed3f7'/>
<id>urn:sha1:82fbf2b9e43fb234f843dc3352fecbd08eeed3f7</id>
<content type='text'>
and _threads.reset(); move the lock.
</content>
</entry>
<entry>
<title>Re-add mutex that was taken away in</title>
<updated>2020-11-04T22:36:56Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-11-04T22:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=0fc3ee1eac41d391ebb79044b0f46849a90f5138'/>
<id>urn:sha1:0fc3ee1eac41d391ebb79044b0f46849a90f5138</id>
<content type='text'>
73ebb92e9df01ba7afb97121b6e2cef6ca13a18e

I'm not sure why it was removed, and it seems necessary;
servers_list_changed() can be called from a variety of different places
(the constructor and two different EncodeServerFinder threads).

May help with #1854.
</content>
</entry>
<entry>
<title>Pass around JPEG2000 data as a shared_ptr and hence avoid a copy</title>
<updated>2020-11-02T22:10:04Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-11-01T22:51:19Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=2ea3a0d0e4066a166c0700bd1d53daa7f1c50dff'/>
<id>urn:sha1:2ea3a0d0e4066a166c0700bd1d53daa7f1c50dff</id>
<content type='text'>
of 4MB of data for every JPEG2000 frame we decode.
</content>
</entry>
<entry>
<title>Remove support for Windows XP.</title>
<updated>2020-09-12T21:19:19Z</updated>
<author>
<name>Carl Hetherington</name>
<email>cth@carlh.net</email>
</author>
<published>2020-09-12T21:19:19Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/dcpomatic/commit/?id=44532cd5f87df3ef10bbbd6b987492e36e4a0eb6'/>
<id>urn:sha1:44532cd5f87df3ef10bbbd6b987492e36e4a0eb6</id>
<content type='text'>
</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>
