mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
The video decoding thread efficiently waits for a video to be created before doing anything, rather than sleeping for 2ms in a loop. Reduces the CPU usage of the video worker thread to ~0% when no videos are loaded.
This commit is contained in:
@@ -77,8 +77,6 @@ Channel::Channel()
|
||||
, sent(0)
|
||||
, received(0)
|
||||
{
|
||||
mutex = newMutex();
|
||||
cond = newConditional();
|
||||
}
|
||||
|
||||
Channel::Channel(const std::string &name)
|
||||
@@ -87,15 +85,10 @@ Channel::Channel(const std::string &name)
|
||||
, sent(0)
|
||||
, received(0)
|
||||
{
|
||||
mutex = newMutex();
|
||||
cond = newConditional();
|
||||
}
|
||||
|
||||
Channel::~Channel()
|
||||
{
|
||||
delete mutex;
|
||||
delete cond;
|
||||
|
||||
if (named)
|
||||
{
|
||||
Lock l(namedChannelMutex);
|
||||
|
||||
Reference in New Issue
Block a user